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_mathutils.py (1 of 7 files). Show all

Unified · Split

python/tests/test_mathutils.py+9−9
@@ -12,7 +12,7 @@ class aubio_mathutils(TestCase): · 11 unmodified lines
1212 def test_unwrap2pi(self):
1313 unwrap2pi(int(23))
1414 unwrap2pi(float(23.))
15− unwrap2pi(long(23.))
15+ unwrap2pi(int(23.))
1616 unwrap2pi(arange(10))
1717 unwrap2pi(arange(10).astype("int"))
1818 unwrap2pi(arange(10).astype("float"))
@@ -27,8 +27,8 @@ class aubio_mathutils(TestCase): · 8 unmodified lines
2727 #print zip(a, b)
2828
2929 try:
30− print unwrap2pi(["23.","24.",25.])
31− except Exception, e:
30+ print (unwrap2pi(["23.","24.",25.]))
31+ except Exception as e:
3232 pass
3333
3434 def test_unwrap2pi_takes_fvec(self):
@@ -53,7 +53,7 @@ class aubio_mathutils(TestCase): · 18 unmodified lines
5353 assert ( b <= pi ).all()
5454
5555 def test_freqtomidi(self):
56− a = array(range(-20, 50000, 100) + [ -1e32, 1e32 ])
56+ a = array(list(range(-20, 50000, 100)) + [ -1e32, 1e32 ])
5757 b = freqtomidi(a)
5858 #print zip(a, b)
5959 assert_equal ( isnan(array(b)), False )
@@ -61,7 +61,7 @@ class aubio_mathutils(TestCase): · 1 unmodified line
6161 assert_equal ( array(b) < 0, False )
6262
6363 def test_miditofreq(self):
64− a = range(-30, 200) + [-100000, 10000]
64+ a = list(range(-30, 200)) + [-100000, 10000]
6565 b = miditofreq(a)
6666 #print zip(a, b)
6767 assert_equal ( isnan(b), False )
@@ -69,7 +69,7 @@ class aubio_mathutils(TestCase): · 1 unmodified line
6969 assert_equal ( b < 0, False )
7070
7171 def test_miditobin(self):
72− a = range(-30, 200) + [-100000, 10000]
72+ a = list(range(-30, 200)) + [-100000, 10000]
7373 b = [ bintomidi(x, 44100, 512) for x in a ]
7474 #print zip(a, b)
7575 assert_equal ( isnan(array(b)), False )
@@ -77,7 +77,7 @@ class aubio_mathutils(TestCase): · 1 unmodified line
7777 assert_equal ( array(b) < 0, False )
7878
7979 def test_bintomidi(self):
80− a = range(-100, 512)
80+ a = list(range(-100, 512))
8181 b = [ bintomidi(x, 44100, 512) for x in a ]
8282 #print zip(a, b)
8383 assert_equal ( isnan(array(b)), False )
@@ -85,7 +85,7 @@ class aubio_mathutils(TestCase): · 1 unmodified line
8585 assert_equal ( array(b) < 0, False )
8686
8787 def test_freqtobin(self):
88− a = range(-20, 50000, 100) + [ -1e32, 1e32 ]
88+ a = list(range(-20, 50000, 100)) + [ -1e32, 1e32 ]
8989 b = [ freqtobin(x, 44100, 512) for x in a ]
9090 #print zip(a, b)
9191 assert_equal ( isnan(array(b)), False )
@@ -93,7 +93,7 @@ class aubio_mathutils(TestCase): · 1 unmodified line
9393 assert_equal ( array(b) < 0, False )
9494
9595 def test_bintofreq(self):
96− a = range(-20, 148)
96+ a = list(range(-20, 148))
9797 b = [ bintofreq(x, 44100, 512) for x in a ]
9898 #print zip(a, b)
9999 assert_equal ( isnan(array(b)), False )

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