Showing the changes to python (6 of 6 files). Show all
Unified · Split
| @@ -21,6 +21,9 @@ try: · 20 unmodified lines | ||
| 21 | 21 | assert_warns = pytest.warns |
| 22 | 22 | skipTest = pytest.skip |
| 23 | 23 | _has_pytest = True |
| 24 | + def run_module_suite(): | |
| 25 | + import sys, pytest | |
| 26 | + pytest.main(sys.argv) | |
| 24 | 27 | except: |
| 25 | 28 | pass |
| 26 | 29 | |
| @@ -31,6 +34,7 @@ if not _has_pytest: · 4 unmodified lines | ||
| 31 | 34 | parametrize = dec.parametrize |
| 32 | 35 | def skipTest(msg): |
| 33 | 36 | raise SkipTest(msg) |
| 37 | + from numpy.testing import run_module_suite | |
| 34 | 38 | |
| 35 | 39 | # always use numpy's assert_equal |
| 36 | 40 | import numpy |
| @@ -106,5 +106,5 @@ class Test_aubio_mfcc_all_parameters(object): · 105 unmodified lines | ||
| 106 | 106 | #print coeffs |
| 107 | 107 | |
| 108 | 108 | if __name__ == '__main__': |
| 109 | − import sys, pytest | |
| 110 | − pytest.main(sys.argv) | |
| 109 | + from _tools import run_module_suite | |
| 110 | + run_module_suite() | |
| @@ -40,5 +40,5 @@ class Test_midi2note_wrong_values(object): · 39 unmodified lines | ||
| 40 | 40 | assert_raises(TypeError, midi2note, "a") |
| 41 | 41 | |
| 42 | 42 | if __name__ == '__main__': |
| 43 | − import sys, pytest | |
| 44 | − pytest.main(sys.argv) | |
| 43 | + from _tools import run_module_suite | |
| 44 | + run_module_suite() | |
| @@ -138,5 +138,5 @@ class note2freq_simple_test(TestCase): · 137 unmodified lines | ||
| 138 | 138 | self.assertLess(abs(note2freq("A4")-440), 1.e-12) |
| 139 | 139 | |
| 140 | 140 | if __name__ == '__main__': |
| 141 | − import sys, pytest | |
| 142 | − pytest.main(sys.argv) | |
| 141 | + from _tools import run_module_suite | |
| 142 | + run_module_suite() | |
| @@ -118,5 +118,5 @@ class Test_aubio_sink(object): · 117 unmodified lines | ||
| 118 | 118 | g(vec, 128) |
| 119 | 119 | |
| 120 | 120 | if __name__ == '__main__': |
| 121 | − import pytest, sys | |
| 122 | − pytest.main(sys.argv) | |
| 121 | + from _tools import run_module_suite | |
| 122 | + run_module_suite() | |
| @@ -187,5 +187,5 @@ class Test_aubio_source_with(object): · 186 unmodified lines | ||
| 187 | 187 | assert_equal(total_frames, input_source.duration) |
| 188 | 188 | |
| 189 | 189 | if __name__ == '__main__': |
| 190 | − import sys, pytest | |
| 191 | − pytest.main(sys.argv) | |
| 190 | + from _tools import run_module_suite | |
| 191 | + run_module_suite() | |