Changeset 7debeb6 for python/tests


Ignore:
Timestamp:
Nov 1, 2018, 10:34:14 PM (6 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/timestretch, fix/ffmpeg5, master
Children:
d4fae34
Parents:
86deeed
Message:

[tests] use _tools in test_phasevoc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/tests/test_phasevoc.py

    r86deeed r7debeb6  
    22
    33from numpy.testing import TestCase, assert_equal, assert_array_less
     4from ._tools import parametrize
    45from aubio import fvec, cvec, pvoc, float_type
    5 from nose2 import main
    6 from nose2.tools import params
    76import numpy as np
    87
     
    1918    return np.random.rand(hop_s).astype(float_type) * 2. - 1.
    2019
    21 class aubio_pvoc_test_case(TestCase):
     20class Test_aubio_pvoc_test_case:
    2221    """ pvoc object test case """
    2322
     
    5756            assert_equal ( r, 0.)
    5857
    59     @params(
     58    resynth_noise_args = "hop_s, ratio"
     59    resynth_noise_values = [
    6060            ( 256, 8),
    6161            ( 256, 4),
     
    7979            (8192, 4),
    8080            (8192, 2),
    81             )
     81            ]
     82
     83    @parametrize(resynth_noise_args, resynth_noise_values)
    8284    def test_resynth_steps_noise(self, hop_s, ratio):
    8385        """ check the resynthesis of a random signal is correct """
     
    8587        self.reconstruction(sigin, hop_s, ratio)
    8688
    87     @params(
     89    resynth_sine_args = "samplerate, hop_s, ratio, freq"
     90    resynth_sine_values = [
    8891            (44100,  256, 8,   441),
    8992            (44100,  256, 4,  1203),
     
    100103            (96000, 1024, 8, 47000),
    101104            (96000, 1024, 8,    20),
    102             )
     105            ]
     106
     107    @parametrize(resynth_sine_args, resynth_sine_values)
    103108    def test_resynth_steps_sine(self, samplerate, hop_s, ratio, freq):
    104109        """ check the resynthesis of a sine is correct """
     
    191196
    192197if __name__ == '__main__':
     198    from unittest import main
    193199    main()
    194 
Note: See TracChangeset for help on using the changeset viewer.