From 0770148df1d357adfa13b198f8687e2072b315e4 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Wed, 19 Dec 2018 19:40:15 +0100 Subject: [PATCH] [test] update pitchshift test --- python/tests/test_pitchshift.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/python/tests/test_pitchshift.py b/python/tests/test_pitchshift.py index 38e19de6..88e03494 100755 --- a/python/tests/test_pitchshift.py +++ b/python/tests/test_pitchshift.py @@ -1,7 +1,7 @@ #! /usr/bin/env python from numpy.testing import TestCase -from nose2.tools import params +from _tools import parametrize import numpy as np import aubio @@ -66,15 +66,18 @@ class aubio_pitchshift_wrong_params(TestCase): with self.assertRaises(RuntimeError): aubio.pitchshift("default", -123) -class aubio_pitchshift_testruns(TestCase): +class Test_aubio_pitchshift_testruns(object): - @params( + run_args = ['mode', 'pitchscale', 'hop_size', 'samplerate'] + run_values = [ ("default", 1.2, 128, 44100), ("crispness:0", 0.43, 64, 8000), ("crispness:3", 0.53, 256, 8000), ("crispness:3", 1.53, 512, 8000), ("crispness:6", 2.3, 4096, 192000), - ) + ] + + @parametrize(run_args, run_values) def test_run_with_params(self, mode, pitchscale, hop_size, samplerate): try: self.o = aubio.pitchshift(mode, pitchscale, hop_size, samplerate) @@ -97,5 +100,5 @@ class aubio_pitchshift_testruns(TestCase): read += len(vec) if __name__ == '__main__': - from nose2 import main - main() + from _tools import run_module_suite + run_module_suite() -- 2.11.0