Changeset 8354cb8


Ignore:
Timestamp:
Nov 10, 2018, 12:00:25 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:
75f9fff
Parents:
ed09ba7c
Message:

[py] add assert_warns to filterbank.set_triangle_bands tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/tests/test_filterbank_mel.py

    red09ba7c r8354cb8  
    7676        freq_list = [0, samplerate//4, samplerate // 2 + 1]
    7777        f = filterbank(len(freq_list)-2, 1024)
    78         # TODO add assert_warns
    79         f.set_triangle_bands(fvec(freq_list), samplerate)
     78        with assert_warns(UserWarning):
     79            f.set_triangle_bands(fvec(freq_list), samplerate)
    8080
    8181    def test_triangle_freqs_with_not_enough_filters(self):
     
    8484        freq_list = [0, 100, 1000, 4000, 8000, 10000]
    8585        f = filterbank(len(freq_list)-3, 1024)
    86         # TODO add assert_warns
    87         f.set_triangle_bands(fvec(freq_list), samplerate)
     86        with assert_warns(UserWarning):
     87            f.set_triangle_bands(fvec(freq_list), samplerate)
    8888
    8989    def test_triangle_freqs_with_too_many_filters(self):
     
    9292        freq_list = [0, 100, 1000, 4000, 8000, 10000]
    9393        f = filterbank(len(freq_list)-1, 1024)
    94         # TODO add assert_warns
    95         f.set_triangle_bands(fvec(freq_list), samplerate)
     94        with assert_warns(UserWarning):
     95            f.set_triangle_bands(fvec(freq_list), samplerate)
    9696
    9797    def test_triangle_freqs_with_double_value(self):
     
    100100        freq_list = [0, 100, 1000, 4000, 4000, 4000, 10000]
    101101        f = filterbank(len(freq_list)-2, 1024)
    102         # TODO add assert_warns
    103         f.set_triangle_bands(fvec(freq_list), samplerate)
     102        with assert_warns(UserWarning):
     103            f.set_triangle_bands(fvec(freq_list), samplerate)
    104104
    105105    def test_triangle_freqs_with_triple(self):
     
    108108        freq_list = [0, 100, 1000, 4000, 4000, 4000, 10000]
    109109        f = filterbank(len(freq_list)-2, 1024)
    110         # TODO add assert_warns
    111         f.set_triangle_bands(fvec(freq_list), samplerate)
     110        with assert_warns(UserWarning):
     111            f.set_triangle_bands(fvec(freq_list), samplerate)
    112112
    113113
Note: See TracChangeset for help on using the changeset viewer.