Changeset 1dfe409 for python/tests/test_source.py
- Timestamp:
- Mar 31, 2019, 11:12:40 PM (5 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/crepe, fix/ffmpeg5, master
- Children:
- 76b6dd3
- Parents:
- 08246ee (diff), f55630c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/tests/test_source.py
r08246ee r1dfe409 4 4 from numpy.testing import TestCase, assert_equal 5 5 from aubio import source 6 from utils import list_all_sounds 6 from utils import list_all_sounds, parse_file_samplerate 7 7 import unittest 8 from _tools import parametrize, assert_raises, assert_equal, skipTest 8 from _tools import assert_raises, assert_equal, assert_warns 9 from _tools import parametrize, skipTest 9 10 10 11 list_of_sounds = list_all_sounds('sounds') … … 23 24 24 25 _debug = False 26 25 27 26 28 class Test_aubio_source_test_case(TestCase): … … 75 77 @parametrize('hop_size, samplerate, soundfile', all_params) 76 78 def test_samplerate_hopsize(self, hop_size, samplerate, soundfile): 79 orig_samplerate = parse_file_samplerate(soundfile) 77 80 try: 78 f = source(soundfile, samplerate, hop_size) 81 if orig_samplerate is not None and orig_samplerate < samplerate: 82 # upsampling should emit a warning 83 with assert_warns(UserWarning): 84 f = source(soundfile, samplerate, hop_size) 85 else: 86 f = source(soundfile, samplerate, hop_size) 79 87 except RuntimeError as e: 80 88 err_msg = 'failed opening with hop_s={:d}, samplerate={:d} ({:s})'
Note: See TracChangeset
for help on using the changeset viewer.