Showing the changes to python (8 of 8 files). Show all
Unified · Split
| @@ -1,6 +1,5 @@ | |||
| 1 | #! /usr/bin/env python | 1 | #! /usr/bin/env python |
| 2 | 2 | ||
| 3 | from unittest import main | ||
| 4 | from numpy.testing import TestCase | 3 | from numpy.testing import TestCase |
| 5 | from numpy.testing import assert_equal, assert_almost_equal | 4 | from numpy.testing import assert_equal, assert_almost_equal |
| 6 | import numpy as np | 5 | import numpy as np |
| @@ -192,4 +191,5 @@ class aubio_fft_wrong_params(TestCase): · 185 unmodified lines | |||
| 192 | fft(win_s) | 191 | fft(win_s) |
| 193 | 192 | ||
| 194 | if __name__ == '__main__': | 193 | if __name__ == '__main__': |
| 194 | from unittest import main | ||
| 195 | main() | 195 | main() |
| @@ -1,6 +1,5 @@ | |||
| 1 | #! /usr/bin/env python | 1 | #! /usr/bin/env python |
| 2 | 2 | ||
| 3 | from unittest import main | ||
| 4 | from numpy.testing import TestCase, assert_equal, assert_almost_equal | 3 | from numpy.testing import TestCase, assert_equal, assert_almost_equal |
| 5 | from aubio import fvec, digital_filter | 4 | from aubio import fvec, digital_filter |
| 6 | from .utils import array_from_text_file | 5 | from .utils import array_from_text_file |
| @@ -84,4 +83,5 @@ class aubio_filter_wrong_params(TestCase): · 77 unmodified lines | |||
| 84 | digital_filter(-1) | 83 | digital_filter(-1) |
| 85 | 84 | ||
| 86 | if __name__ == '__main__': | 85 | if __name__ == '__main__': |
| 86 | from unittest import main | ||
| 87 | main() | 87 | main() |
| @@ -87,5 +87,5 @@ class aubio_filterbank_wrong_values(TestCase): · 86 unmodified lines | |||
| 87 | f(cvec(256)) | 87 | f(cvec(256)) |
| 88 | 88 | ||
| 89 | if __name__ == '__main__': | 89 | if __name__ == '__main__': |
| 90 | import nose2 | 90 | from unittest import main |
| 91 | nose2.main() | 91 | main() |
| @@ -48,5 +48,5 @@ class aubio_filterbank_mel_test_case(TestCase): · 47 unmodified lines | |||
| 48 | 0.02133301, 0.02133301, 0.02133311, 0.02133334, 0.02133345]) | 48 | 0.02133301, 0.02133301, 0.02133311, 0.02133334, 0.02133345]) |
| 49 | 49 | ||
| 50 | if __name__ == '__main__': | 50 | if __name__ == '__main__': |
| 51 | import nose2 | 51 | from unittest import main |
| 52 | nose2.main() | 52 | main() |
| @@ -30,6 +30,6 @@ class aubio_shift_test_case(TestCase): · 29 unmodified lines | |||
| 30 | def test_can_shift_fvec_odd(self): | 30 | def test_can_shift_fvec_odd(self): |
| 31 | self.run_shift_ishift(7) | 31 | self.run_shift_ishift(7) |
| 32 | 32 | ||
| 33 | from unittest import main | ||
| 34 | if __name__ == '__main__': | 33 | if __name__ == '__main__': |
| 34 | from unittest import main | ||
| 35 | main() | 35 | main() |
| @@ -1,6 +1,5 @@ | |||
| 1 | #! /usr/bin/env python | 1 | #! /usr/bin/env python |
| 2 | 2 | ||
| 3 | from unittest import main | ||
| 4 | from numpy.testing import TestCase, assert_equal | 3 | from numpy.testing import TestCase, assert_equal |
| 5 | from numpy import array, arange, isnan, isinf | 4 | from numpy import array, arange, isnan, isinf |
| 6 | from aubio import bintomidi, miditobin, freqtobin, bintofreq, freqtomidi, miditofreq | 5 | from aubio import bintomidi, miditobin, freqtobin, bintofreq, freqtomidi, miditofreq |
| @@ -101,4 +100,5 @@ class aubio_mathutils(TestCase): · 94 unmodified lines | |||
| 101 | assert_equal ( array(b) < 0, False ) | 100 | assert_equal ( array(b) < 0, False ) |
| 102 | 101 | ||
| 103 | if __name__ == '__main__': | 102 | if __name__ == '__main__': |
| 103 | from unittest import main | ||
| 104 | main() | 104 | main() |
| @@ -1,6 +1,5 @@ | |||
| 1 | #! /usr/bin/env python | 1 | #! /usr/bin/env python |
| 2 | 2 | ||
| 3 | from unittest import main | ||
| 4 | import numpy as np | 3 | import numpy as np |
| 5 | from numpy.testing import TestCase | 4 | from numpy.testing import TestCase |
| 6 | from numpy.testing.utils import assert_equal, assert_almost_equal | 5 | from numpy.testing.utils import assert_equal, assert_almost_equal |
| @@ -85,4 +84,5 @@ class aubio_level_detection(TestCase): · 78 unmodified lines | |||
| 85 | assert level_detection(ones(1024, dtype = float_type), -70) == 0 | 84 | assert level_detection(ones(1024, dtype = float_type), -70) == 0 |
| 86 | 85 | ||
| 87 | if __name__ == '__main__': | 86 | if __name__ == '__main__': |
| 87 | from unittest import main | ||
| 88 | main() | 88 | main() |
| @@ -1,6 +1,5 @@ | |||
| 1 | #! /usr/bin/env python | 1 | #! /usr/bin/env python |
| 2 | 2 | ||
| 3 | from unittest import main | ||
| 4 | from numpy.testing import TestCase, assert_equal, assert_almost_equal | 3 | from numpy.testing import TestCase, assert_equal, assert_almost_equal |
| 5 | from aubio import onset | 4 | from aubio import onset |
| 6 | 5 | ||
| @@ -84,4 +83,5 @@ class aubio_onset_8000(aubio_onset_params): · 77 unmodified lines | |||
| 84 | samplerate = 8000 | 83 | samplerate = 8000 |
| 85 | 84 | ||
| 86 | if __name__ == '__main__': | 85 | if __name__ == '__main__': |
| 86 | from unittest import main | ||
| 87 | main() | 87 | main() |