History

[test] update pitchshift test

Paul Brossier committed 7 years ago

Commit 07701481 parent d0f19a71 file · +9 −6Browse files

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

Unified · Split

python/tests/test_pitchshift.py+9−6
@@ -1,7 +1,7 @@
11 #! /usr/bin/env python
22
33 from numpy.testing import TestCase
4−from nose2.tools import params
4+from _tools import parametrize
55 import numpy as np
66 import aubio
77
@@ -66,15 +66,18 @@ class aubio_pitchshift_wrong_params(TestCase): · 58 unmodified lines
6666 with self.assertRaises(RuntimeError):
6767 aubio.pitchshift("default", -123)
6868
69−class aubio_pitchshift_testruns(TestCase):
69+class Test_aubio_pitchshift_testruns(object):
7070
71− @params(
71+ run_args = ['mode', 'pitchscale', 'hop_size', 'samplerate']
72+ run_values = [
7273 ("default", 1.2, 128, 44100),
7374 ("crispness:0", 0.43, 64, 8000),
7475 ("crispness:3", 0.53, 256, 8000),
7576 ("crispness:3", 1.53, 512, 8000),
7677 ("crispness:6", 2.3, 4096, 192000),
77− )
78+ ]
79+
80+ @parametrize(run_args, run_values)
7881 def test_run_with_params(self, mode, pitchscale, hop_size, samplerate):
7982 try:
8083 self.o = aubio.pitchshift(mode, pitchscale, hop_size, samplerate)
@@ -97,5 +100,5 @@ class aubio_pitchshift_testruns(TestCase): · 16 unmodified lines
97100 read += len(vec)
98101
99102 if __name__ == '__main__':
100− from nose2 import main
101− main()
103+ from _tools import run_module_suite
104+ run_module_suite()

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