History

[tests] move imports to top except main

Paul Brossier committed 8 years ago

Commit 40b2be21 parent 319edae1 file · +6 −7Browse files

Showing the changes to python/tests (1 of 1 file). Show all

Unified · Split

python/tests/test_notes.py+6−7
@@ -1,8 +1,11 @@
11 #! /usr/bin/env python
22
3−from unittest import main
43 from numpy.testing import TestCase, assert_equal, assert_almost_equal
5−from aubio import notes
4+from aubio import notes, source
5+import numpy as np
6+from .utils import list_all_sounds
7+
8+list_of_sounds = list_all_sounds('sounds')
69
710 AUBIO_DEFAULT_NOTES_SILENCE = -70.
811 AUBIO_DEFAULT_NOTES_RELEASE_DROP = 10.
@@ -52,14 +55,9 @@ class aubio_notes_params(TestCase): · 43 unmodified lines
5255 with self.assertRaises(ValueError):
5356 self.o.set_release_drop(val)
5457
55−from .utils import list_all_sounds
56−list_of_sounds = list_all_sounds('sounds')
57−
5858 class aubio_notes_sinewave(TestCase):
5959
6060 def analyze_file(self, filepath, samplerate=0):
61− from aubio import source
62− import numpy as np
6361 win_s = 512 # fft size
6462 hop_s = 256 # hop size
6563
@@ -92,4 +90,5 @@ class aubio_notes_sinewave(TestCase): · 26 unmodified lines
9290 assert_equal (results[0][1], [69, 123, -1])
9391
9492 if __name__ == '__main__':
93+ from unittest import main
9594 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