Showing the changes to python/tests/test_source.py (1 of 7 files). Show all
Unified · Split
| @@ -38,10 +38,10 @@ class aubio_source_read_test_case(aubio_source_test_case_base): · 37 unmodified lines | ||
| 38 | 38 | vec, read = f() |
| 39 | 39 | total_frames += read |
| 40 | 40 | if read < f.hop_size: break |
| 41 | − print "read", "%.2fs" % (total_frames / float(f.samplerate) ), | |
| 42 | − print "(", total_frames, "frames", "in", | |
| 43 | − print total_frames / f.hop_size, "blocks", "at", "%dHz" % f.samplerate, ")", | |
| 44 | − print "from", f.uri | |
| 41 | + print ("read", "%.2fs" % (total_frames / float(f.samplerate) ) ), | |
| 42 | + print ("(", total_frames, "frames", "in" ), | |
| 43 | + print (total_frames / f.hop_size, "blocks", "at", "%dHz" % f.samplerate, ")" ), | |
| 44 | + print ("from", f.uri) | |
| 45 | 45 | return total_frames |
| 46 | 46 | |
| 47 | 47 | def test_samplerate_hopsize(self): |
| @@ -67,7 +67,7 @@ class aubio_source_read_test_case(aubio_source_test_case_base): · 19 unmodified lines | ||
| 67 | 67 | for p in list_of_sounds: |
| 68 | 68 | try: |
| 69 | 69 | f = source(p, -1) |
| 70 | − except ValueError, e: | |
| 70 | + except ValueError as e: | |
| 71 | 71 | pass |
| 72 | 72 | else: |
| 73 | 73 | self.fail('negative samplerate does not raise ValueError') |
| @@ -76,7 +76,7 @@ class aubio_source_read_test_case(aubio_source_test_case_base): · 2 unmodified lines | ||
| 76 | 76 | for p in list_of_sounds: |
| 77 | 77 | try: |
| 78 | 78 | f = source(p, 0, -1) |
| 79 | − except ValueError, e: | |
| 79 | + except ValueError as e: | |
| 80 | 80 | pass |
| 81 | 81 | else: |
| 82 | 82 | self.fail('negative hop_size does not raise ValueError') |
| @@ -108,11 +108,11 @@ class aubio_source_readmulti_test_case(aubio_source_read_test_case): · 25 unmodified lines | ||
| 108 | 108 | vec, read = f.do_multi() |
| 109 | 109 | total_frames += read |
| 110 | 110 | if read < f.hop_size: break |
| 111 | − print "read", "%.2fs" % (total_frames / float(f.samplerate) ), | |
| 112 | − print "(", total_frames, "frames", "in", | |
| 113 | − print f.channels, "channels and", | |
| 114 | − print total_frames / f.hop_size, "blocks", "at", "%dHz" % f.samplerate, ")", | |
| 115 | − print "from", f.uri | |
| 111 | + print ("read", "%.2fs" % (total_frames / float(f.samplerate) ) ), | |
| 112 | + print ("(", total_frames, "frames", "in" ), | |
| 113 | + print (f.channels, "channels and" ), | |
| 114 | + print (total_frames / f.hop_size, "blocks", "at", "%dHz" % f.samplerate, ")" ), | |
| 115 | + print ("from", f.uri) | |
| 116 | 116 | return total_frames |
| 117 | 117 | |
| 118 | 118 | if __name__ == '__main__': |