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 | vec, read = f() | 38 | vec, read = f() |
| 39 | total_frames += read | 39 | total_frames += read |
| 40 | if read < f.hop_size: break | 40 | if read < f.hop_size: break |
| 41 | print "read", "%.2fs" % (total_frames / float(f.samplerate) ), | 41 | print ("read", "%.2fs" % (total_frames / float(f.samplerate) ) ), |
| 42 | print "(", total_frames, "frames", "in", | 42 | print ("(", total_frames, "frames", "in" ), |
| 43 | print total_frames / f.hop_size, "blocks", "at", "%dHz" % f.samplerate, ")", | 43 | print (total_frames / f.hop_size, "blocks", "at", "%dHz" % f.samplerate, ")" ), |
| 44 | print "from", f.uri | 44 | print ("from", f.uri) |
| 45 | return total_frames | 45 | return total_frames |
| 46 | 46 | ||
| 47 | def test_samplerate_hopsize(self): | 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 | for p in list_of_sounds: | 67 | for p in list_of_sounds: |
| 68 | try: | 68 | try: |
| 69 | f = source(p, -1) | 69 | f = source(p, -1) |
| 70 | except ValueError, e: | 70 | except ValueError as e: |
| 71 | pass | 71 | pass |
| 72 | else: | 72 | else: |
| 73 | self.fail('negative samplerate does not raise ValueError') | 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 | for p in list_of_sounds: | 76 | for p in list_of_sounds: |
| 77 | try: | 77 | try: |
| 78 | f = source(p, 0, -1) | 78 | f = source(p, 0, -1) |
| 79 | except ValueError, e: | 79 | except ValueError as e: |
| 80 | pass | 80 | pass |
| 81 | else: | 81 | else: |
| 82 | self.fail('negative hop_size does not raise ValueError') | 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 | vec, read = f.do_multi() | 108 | vec, read = f.do_multi() |
| 109 | total_frames += read | 109 | total_frames += read |
| 110 | if read < f.hop_size: break | 110 | if read < f.hop_size: break |
| 111 | print "read", "%.2fs" % (total_frames / float(f.samplerate) ), | 111 | print ("read", "%.2fs" % (total_frames / float(f.samplerate) ) ), |
| 112 | print "(", total_frames, "frames", "in", | 112 | print ("(", total_frames, "frames", "in" ), |
| 113 | print f.channels, "channels and", | 113 | print (f.channels, "channels and" ), |
| 114 | print total_frames / f.hop_size, "blocks", "at", "%dHz" % f.samplerate, ")", | 114 | print (total_frames / f.hop_size, "blocks", "at", "%dHz" % f.samplerate, ")" ), |
| 115 | print "from", f.uri | 115 | print ("from", f.uri) |
| 116 | return total_frames | 116 | return total_frames |
| 117 | 117 | ||
| 118 | if __name__ == '__main__': | 118 | if __name__ == '__main__': |