From: Paul Brossier Date: Fri, 2 Nov 2018 21:09:36 +0000 (+0100) Subject: [tests] [py27] make sure all classes are old-school 'new-style' X-Git-Tag: 0.4.9~71^2~20 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=8607a74536678d2c6d2fceca750c4ccf6c1d174d;p=aubio.git [tests] [py27] make sure all classes are old-school 'new-style' --- diff --git a/python/tests/test_mfcc.py b/python/tests/test_mfcc.py index f62083a0..f25fb9d8 100755 --- a/python/tests/test_mfcc.py +++ b/python/tests/test_mfcc.py @@ -14,7 +14,7 @@ samplerate = 44100 new_params = ['buf_size', 'n_filters', 'n_coeffs', 'samplerate'] new_deflts = [1024, 40, 13, 44100] -class Test_aubio_mfcc: +class Test_aubio_mfcc(object): members_args = 'name' @@ -74,7 +74,7 @@ class aubio_mfcc_compute(TestCase): #print coeffs -class Test_aubio_mfcc_all_parameters: +class Test_aubio_mfcc_all_parameters(object): run_values = [ (2048, 40, 13, 44100), diff --git a/python/tests/test_midi2note.py b/python/tests/test_midi2note.py index f71a9e1e..63ceda8a 100755 --- a/python/tests/test_midi2note.py +++ b/python/tests/test_midi2note.py @@ -14,14 +14,14 @@ list_of_known_midis = ( ( 127, 'G9' ), ) -class Test_midi2note_good_values: +class Test_midi2note_good_values(object): @parametrize('midi, note', list_of_known_midis) def test_midi2note_known_values(self, midi, note): " known values are correctly converted " assert midi2note(midi) == (note) -class Test_midi2note_wrong_values: +class Test_midi2note_wrong_values(object): def test_midi2note_negative_value(self): " fails when passed a negative value " diff --git a/python/tests/test_note2midi.py b/python/tests/test_note2midi.py index ffc087cb..cfa1db68 100755 --- a/python/tests/test_note2midi.py +++ b/python/tests/test_note2midi.py @@ -44,7 +44,7 @@ list_of_unknown_notes = ( ( '2' ), ) -class Test_note2midi_good_values: +class Test_note2midi_good_values(object): @parametrize('note, midi', list_of_known_notes) def test_note2midi_known_values(self, note, midi): @@ -107,7 +107,7 @@ class note2midi_wrong_values(TestCase): " fails when passed a note with a note name longer than expected" self.assertRaises(ValueError, note2midi, 'CB+-3') -class Test_note2midi_unknown_values: +class Test_note2midi_unknown_values(object): @parametrize('note', list_of_unknown_notes) def test_note2midi_unknown_values(self, note): diff --git a/python/tests/test_phasevoc.py b/python/tests/test_phasevoc.py index a38c3c86..e17d1fda 100755 --- a/python/tests/test_phasevoc.py +++ b/python/tests/test_phasevoc.py @@ -17,7 +17,7 @@ def create_sine(hop_s, freq, samplerate): def create_noise(hop_s): return np.random.rand(hop_s).astype(float_type) * 2. - 1. -class Test_aubio_pvoc_test_case: +class Test_aubio_pvoc_test_case(object): """ pvoc object test case """ def test_members_automatic_sizes_default(self): diff --git a/python/tests/test_sink.py b/python/tests/test_sink.py index 2e0a04b4..51f60ea0 100755 --- a/python/tests/test_sink.py +++ b/python/tests/test_sink.py @@ -19,7 +19,7 @@ for soundfile in list_of_sounds: for samplerate in samplerates: all_params.append((hop_size, samplerate, soundfile)) -class Test_aubio_sink: +class Test_aubio_sink(object): def test_wrong_filename(self): with assert_raises(RuntimeError): diff --git a/python/tests/test_source.py b/python/tests/test_source.py index cca8132f..0ab87aed 100755 --- a/python/tests/test_source.py +++ b/python/tests/test_source.py @@ -23,7 +23,7 @@ no_sounds_msg = "no test sounds, add some in 'python/tests/sounds/'!" _debug = False -class Test_aubio_source_test_case: +class Test_aubio_source_test_case(object): @parametrize('filename', list_of_sounds) def test_close_file(self, filename): @@ -40,7 +40,7 @@ class Test_aubio_source_test_case: f.close() f.close() -class Test_aubio_source_read: +class Test_aubio_source_read(object): def read_from_source(self, f): total_frames = 0 @@ -118,7 +118,7 @@ class Test_aubio_source_read: assert_equal (duration, total_frames) -class Test_aubio_source_wrong_params: +class Test_aubio_source_wrong_params(object): def test_wrong_file(self): with assert_raises(RuntimeError): @@ -171,7 +171,7 @@ class Test_aubio_source_readmulti(Test_aubio_source_read): print (result_str.format(*result_params)) return total_frames -class Test_aubio_source_with: +class Test_aubio_source_with(object): @parametrize('filename', list_of_sounds) def test_read_from_mono(self, filename):