shithub: aubio

Download patch

ref: fc144a51298f7ba6eb28e3ad2cdadb088231f199
parent: fedb139a24ce9bcae86422c4d8e700bc62321782
author: Paul Brossier <piem@piem.org>
date: Wed Oct 31 22:11:08 EDT 2018

[tests] avoid some imports, add missing main

--- a/python/tests/test_aubio.py
+++ b/python/tests/test_aubio.py
@@ -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 @@
         self.assertEqual('0', aubio.version[0])
 
 if __name__ == '__main__':
+    from unittest import main
     main()
-
--- a/python/tests/test_aubio_cmd.py
+++ b/python/tests/test_aubio_cmd.py
@@ -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 @@
                 "3200\t")
 
 if __name__ == '__main__':
+    from unittest import main
     main()
--- a/python/tests/test_aubio_cut.py
+++ b/python/tests/test_aubio_cut.py
@@ -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 @@
         assert self.a_parser.parse_args(['-v']).verbose
 
 if __name__ == '__main__':
+    from unittest import main
     main()
--- a/python/tests/test_cvec.py
+++ b/python/tests/test_cvec.py
@@ -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 @@
             a.norm = np.zeros((512//2+1, 2), dtype = float_type)
 
 if __name__ == '__main__':
+    from unittest import main
     main()
--- a/python/tests/test_dct.py
+++ b/python/tests/test_dct.py
@@ -66,3 +66,7 @@
                 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()
--- a/python/tests/test_fvec.py
+++ b/python/tests/test_fvec.py
@@ -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 @@
         del c
 
 if __name__ == '__main__':
+    from unittest import main
     main()