Ignore:
Timestamp:
Apr 18, 2016, 11:24:47 PM (9 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
6db7600
Parents:
1c6fe64
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/tests/test_mathutils.py

    r1c6fe64 r689106e  
    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"))
     
    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
     
    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)
     
    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)
     
    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)
     
    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)
     
    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)
     
    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)
Note: See TracChangeset for help on using the changeset viewer.