[tests] avoid some imports, add missing main
authorPaul Brossier <piem@piem.org>
Thu, 1 Nov 2018 01:11:08 +0000 (02:11 +0100)
committerPaul Brossier <piem@piem.org>
Thu, 1 Nov 2018 01:11:08 +0000 (02:11 +0100)
python/tests/test_aubio.py
python/tests/test_aubio_cmd.py
python/tests/test_aubio_cut.py
python/tests/test_cvec.py
python/tests/test_dct.py
python/tests/test_fvec.py

index 98a6115..5768cac 100755 (executable)
@@ -1,6 +1,5 @@
 #! /usr/bin/env python
 
-from unittest import main
 from numpy.testing import TestCase
 
 class aubiomodule_test_case(TestCase):
@@ -15,5 +14,5 @@ class aubiomodule_test_case(TestCase):
         self.assertEqual('0', aubio.version[0])
 
 if __name__ == '__main__':
+    from unittest import main
     main()
-
index 44e16fb..471ac85 100755 (executable)
@@ -1,8 +1,7 @@
 #! /usr/bin/env python
 
-import aubio.cmd
-from nose2 import main
 from numpy.testing import TestCase
+import aubio.cmd
 
 class aubio_cmd(TestCase):
 
@@ -31,4 +30,5 @@ class aubio_cmd_utils(TestCase):
                 "3200\t")
 
 if __name__ == '__main__':
+    from unittest import main
     main()
index cbbfe05..01ad2c6 100755 (executable)
@@ -1,7 +1,6 @@
 #! /usr/bin/env python
 
 import aubio.cut
-from nose2 import main
 from numpy.testing import TestCase
 
 class aubio_cut(TestCase):
@@ -13,4 +12,5 @@ class aubio_cut(TestCase):
         assert self.a_parser.parse_args(['-v']).verbose
 
 if __name__ == '__main__':
+    from unittest import main
     main()
index 5632784..73ee654 100755 (executable)
@@ -1,6 +1,5 @@
 #! /usr/bin/env python
 
-from unittest import main
 import numpy as np
 from numpy.testing import TestCase, assert_equal
 from aubio import cvec, fvec, float_type
@@ -141,4 +140,5 @@ class aubio_cvec_wrong_norm_input(TestCase):
             a.norm = np.zeros((512//2+1, 2), dtype = float_type)
 
 if __name__ == '__main__':
+    from unittest import main
     main()
index 0c990f9..c9b2ba7 100755 (executable)
@@ -66,3 +66,7 @@ class aubio_dct(TestCase):
                 aubio.dct(size)
         except AssertionError:
             self.skipTest('creating aubio.dct with size %d did not fail' % size)
+
+if __name__ == '__main__':
+    from unittest import main
+    main()
index 60623ac..765c9fe 100755 (executable)
@@ -1,6 +1,5 @@
 #! /usr/bin/env python
 
-from unittest import main
 import numpy as np
 from numpy.testing import TestCase, assert_equal, assert_almost_equal
 from aubio import fvec, zero_crossing_rate, alpha_norm, min_removal
@@ -148,4 +147,5 @@ class aubio_fvec_test_memory(TestCase):
         del c
 
 if __name__ == '__main__':
+    from unittest import main
     main()