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