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 @@
1#! /usr/bin/env python1#! /usr/bin/env python
2 2
3from numpy.testing import TestCase3from numpy.testing import TestCase
4from nose2.tools import params4from _tools import parametrize
5import numpy as np5import numpy as np
6import aubio6import aubio
7 7
@@ -66,15 +66,18 @@ class aubio_pitchshift_wrong_params(TestCase): · 58 unmodified lines
66 with self.assertRaises(RuntimeError):66 with self.assertRaises(RuntimeError):
67 aubio.pitchshift("default", -123)67 aubio.pitchshift("default", -123)
68 68
69class aubio_pitchshift_testruns(TestCase):69class Test_aubio_pitchshift_testruns(object):
70 70
71 @params(71 run_args = ['mode', 'pitchscale', 'hop_size', 'samplerate']
72 run_values = [
72 ("default", 1.2, 128, 44100),73 ("default", 1.2, 128, 44100),
73 ("crispness:0", 0.43, 64, 8000),74 ("crispness:0", 0.43, 64, 8000),
74 ("crispness:3", 0.53, 256, 8000),75 ("crispness:3", 0.53, 256, 8000),
75 ("crispness:3", 1.53, 512, 8000),76 ("crispness:3", 1.53, 512, 8000),
76 ("crispness:6", 2.3, 4096, 192000),77 ("crispness:6", 2.3, 4096, 192000),
77 )78 ]
79
80 @parametrize(run_args, run_values)
78 def test_run_with_params(self, mode, pitchscale, hop_size, samplerate):81 def test_run_with_params(self, mode, pitchscale, hop_size, samplerate):
79 try:82 try:
80 self.o = aubio.pitchshift(mode, pitchscale, hop_size, samplerate)83 self.o = aubio.pitchshift(mode, pitchscale, hop_size, samplerate)
@@ -97,5 +100,5 @@ class aubio_pitchshift_testruns(TestCase): · 16 unmodified lines
97 read += len(vec)100 read += len(vec)
98 101
99if __name__ == '__main__':102if __name__ == '__main__':
100 from nose2 import main103 from _tools import run_module_suite
101 main()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