From 40b2be270e7f71b844a4fdd03f069345f21dbc3f Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Thu, 1 Nov 2018 02:54:05 +0100 Subject: [PATCH] [tests] move imports to top except main --- python/tests/test_notes.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/python/tests/test_notes.py b/python/tests/test_notes.py index 5b65046f..87612cb4 100755 --- a/python/tests/test_notes.py +++ b/python/tests/test_notes.py @@ -1,8 +1,11 @@ #! /usr/bin/env python -from unittest import main from numpy.testing import TestCase, assert_equal, assert_almost_equal -from aubio import notes +from aubio import notes, source +import numpy as np +from .utils import list_all_sounds + +list_of_sounds = list_all_sounds('sounds') AUBIO_DEFAULT_NOTES_SILENCE = -70. AUBIO_DEFAULT_NOTES_RELEASE_DROP = 10. @@ -52,14 +55,9 @@ class aubio_notes_params(TestCase): with self.assertRaises(ValueError): self.o.set_release_drop(val) -from .utils import list_all_sounds -list_of_sounds = list_all_sounds('sounds') - class aubio_notes_sinewave(TestCase): def analyze_file(self, filepath, samplerate=0): - from aubio import source - import numpy as np win_s = 512 # fft size hop_s = 256 # hop size @@ -92,4 +90,5 @@ class aubio_notes_sinewave(TestCase): assert_equal (results[0][1], [69, 123, -1]) if __name__ == '__main__': + from unittest import main main() -- 2.11.0