Changeset 00fcc5d
- Timestamp:
- Nov 2, 2018, 7:03:01 PM (6 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/timestretch, fix/ffmpeg5, master
- Children:
- 5af36fa
- Parents:
- a3f2695
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/tests/test_note2midi.py
ra3f2695 r00fcc5d 6 6 from aubio import note2midi, freq2note, note2freq, float_type 7 7 from numpy.testing import TestCase 8 from _tools import parametrize, assert_raises 8 from _tools import parametrize, assert_raises, skipTest 9 9 10 10 list_of_known_notes = ( … … 54 54 @parametrize('note, midi', list_of_known_notes_with_unicode_issues) 55 55 def test_note2midi_known_values_with_unicode_issues(self, note, midi): 56 " known values are correctly converted, unless decoding is expected to fail"56 " difficult values are correctly converted unless expected failure " 57 57 try: 58 58 assert note2midi(note) == midi 59 59 except UnicodeEncodeError as e: 60 # platforms with decoding failures include: 61 # - osx: python <= 2.7.10 62 # - win: python <= 2.7.12 60 63 import sys 61 str fmt = "len(u'\\U0001D12A') != 1, excpected decoding failure | {:s} | {:s} {:s}"62 str res = strfmt.format(e, sys.platform, sys.version)63 # happens with: darwin 2.7.10, windows 2.7.1264 strmsg = "len(u'\\U0001D12A') != 1, expected decoding failure" 65 strmsg += " | upgrade to Python 3 to fix" 66 strmsg += " | {:s} | {:s} {:s}" 64 67 if len('\U0001D12A') != 1 and sys.version[0] == '2': 65 skipTest(str res + " | upgrade to Python 3 to fix")68 skipTest(strmsg.format(repr(e), sys.platform, sys.version)) 66 69 else: 67 70 raise … … 136 139 137 140 if __name__ == '__main__': 138 from unittest import main139 main()141 import sys, pytest 142 pytest.main(sys.argv)
Note: See TracChangeset
for help on using the changeset viewer.