History

[tests] avoid some imports, move main to end

Paul Brossier committed 8 years ago

Commit 319edae1 parent 48a0e5a8 files · +10 −10Browse files

Showing the changes to python (8 of 8 files). Show all

Unified · Split

8 files
  1. python/tests/test_fft.py +1 −1
  2. python/tests/test_filter.py +1 −1
  3. python/tests/test_filterbank.py +2 −2
  4. python/tests/test_filterbank_mel.py +2 −2
  5. python/tests/test_fvec_shift.py +1 −1
  6. python/tests/test_mathutils.py +1 −1
  7. python/tests/test_musicutils.py +1 −1
  8. python/tests/test_onset.py +1 −1
python/tests/test_fft.py+1−1
@@ -1,6 +1,5 @@
1#! /usr/bin/env python1#! /usr/bin/env python
2 2
3from unittest import main
4from numpy.testing import TestCase3from numpy.testing import TestCase
5from numpy.testing import assert_equal, assert_almost_equal4from numpy.testing import assert_equal, assert_almost_equal
6import numpy as np5import 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
194if __name__ == '__main__':193if __name__ == '__main__':
194 from unittest import main
195 main()195 main()
python/tests/test_filter.py+1−1
@@ -1,6 +1,5 @@
1#! /usr/bin/env python1#! /usr/bin/env python
2 2
3from unittest import main
4from numpy.testing import TestCase, assert_equal, assert_almost_equal3from numpy.testing import TestCase, assert_equal, assert_almost_equal
5from aubio import fvec, digital_filter4from aubio import fvec, digital_filter
6from .utils import array_from_text_file5from .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
86if __name__ == '__main__':85if __name__ == '__main__':
86 from unittest import main
87 main()87 main()
python/tests/test_filterbank.py+2−2
@@ -87,5 +87,5 @@ class aubio_filterbank_wrong_values(TestCase): · 86 unmodified lines
87 f(cvec(256))87 f(cvec(256))
88 88
89if __name__ == '__main__':89if __name__ == '__main__':
90 import nose290 from unittest import main
91 nose2.main()91 main()
python/tests/test_filterbank_mel.py+2−2
@@ -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
50if __name__ == '__main__':50if __name__ == '__main__':
51 import nose251 from unittest import main
52 nose2.main()52 main()
python/tests/test_fvec_shift.py+1−1
@@ -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
33from unittest import main
34if __name__ == '__main__':33if __name__ == '__main__':
34 from unittest import main
35 main()35 main()
python/tests/test_mathutils.py+1−1
@@ -1,6 +1,5 @@
1#! /usr/bin/env python1#! /usr/bin/env python
2 2
3from unittest import main
4from numpy.testing import TestCase, assert_equal3from numpy.testing import TestCase, assert_equal
5from numpy import array, arange, isnan, isinf4from numpy import array, arange, isnan, isinf
6from aubio import bintomidi, miditobin, freqtobin, bintofreq, freqtomidi, miditofreq5from 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
103if __name__ == '__main__':102if __name__ == '__main__':
103 from unittest import main
104 main()104 main()
python/tests/test_musicutils.py+1−1
@@ -1,6 +1,5 @@
1#! /usr/bin/env python1#! /usr/bin/env python
2 2
3from unittest import main
4import numpy as np3import numpy as np
5from numpy.testing import TestCase4from numpy.testing import TestCase
6from numpy.testing.utils import assert_equal, assert_almost_equal5from 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) == 084 assert level_detection(ones(1024, dtype = float_type), -70) == 0
86 85
87if __name__ == '__main__':86if __name__ == '__main__':
87 from unittest import main
88 main()88 main()
python/tests/test_onset.py+1−1
@@ -1,6 +1,5 @@
1#! /usr/bin/env python1#! /usr/bin/env python
2 2
3from unittest import main
4from numpy.testing import TestCase, assert_equal, assert_almost_equal3from numpy.testing import TestCase, assert_equal, assert_almost_equal
5from aubio import onset4from aubio import onset
6 5
@@ -84,4 +83,5 @@ class aubio_onset_8000(aubio_onset_params): · 77 unmodified lines
84 samplerate = 800083 samplerate = 8000
85 84
86if __name__ == '__main__':85if __name__ == '__main__':
86 from unittest import main
87 main()87 main()

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t