History

python/tests/: prepare for python3 (see #33)

Paul Brossier committed 10 years ago

Commit 689106e1 parent 1c6fe647 files · +53 −53Browse files

Showing the changes to python/tests/test_source.py (1 of 7 files). Show all

Unified · Split

python/tests/test_source.py+11−11
@@ -38,10 +38,10 @@ class aubio_source_read_test_case(aubio_source_test_case_base): · 37 unmodified lines
3838 vec, read = f()
3939 total_frames += read
4040 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)
4545 return total_frames
4646
4747 def test_samplerate_hopsize(self):
@@ -67,7 +67,7 @@ class aubio_source_read_test_case(aubio_source_test_case_base): · 19 unmodified lines
6767 for p in list_of_sounds:
6868 try:
6969 f = source(p, -1)
70− except ValueError, e:
70+ except ValueError as e:
7171 pass
7272 else:
7373 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
7676 for p in list_of_sounds:
7777 try:
7878 f = source(p, 0, -1)
79− except ValueError, e:
79+ except ValueError as e:
8080 pass
8181 else:
8282 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
108108 vec, read = f.do_multi()
109109 total_frames += read
110110 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)
116116 return total_frames
117117
118118 if __name__ == '__main__':

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t