shithub: aubio

Download patch

ref: 8607a74536678d2c6d2fceca750c4ccf6c1d174d
parent: 67024ff73e3e2ef77483a01b789ccd129c309500
author: Paul Brossier <piem@piem.org>
date: Fri Nov 2 18:09:36 EDT 2018

[tests] [py27] make sure all classes are old-school 'new-style'

--- a/python/tests/test_mfcc.py
+++ b/python/tests/test_mfcc.py
@@ -14,7 +14,7 @@
 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 @@
         #print coeffs
 
 
-class Test_aubio_mfcc_all_parameters:
+class Test_aubio_mfcc_all_parameters(object):
 
     run_values = [
             (2048, 40, 13, 44100),
--- a/python/tests/test_midi2note.py
+++ b/python/tests/test_midi2note.py
@@ -14,7 +14,7 @@
         ( 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):
@@ -21,7 +21,7 @@
         " 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 "
--- a/python/tests/test_note2midi.py
+++ b/python/tests/test_note2midi.py
@@ -44,7 +44,7 @@
         ( '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 @@
         " 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):
--- a/python/tests/test_phasevoc.py
+++ b/python/tests/test_phasevoc.py
@@ -17,7 +17,7 @@
 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):
--- a/python/tests/test_sink.py
+++ b/python/tests/test_sink.py
@@ -19,7 +19,7 @@
         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):
--- a/python/tests/test_source.py
+++ b/python/tests/test_source.py
@@ -23,7 +23,7 @@
 
 _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 @@
         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 @@
         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 @@
             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):