Changeset 30:d5fde7cc2958 in pyenvjasmine


Ignore:
Timestamp:
Jan 18, 2018, 12:57:09 PM (7 years ago)
Author:
Borja Lopez <borja@…>
Branch:
default
Phase:
public
Message:

Make some python3 compatibility changes (bytes/unicode/str mess)

Location:
pyenvjasmine
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pyenvjasmine/runner.py

    r25 r30  
    7272
    7373    while True:
    74         output = p.stdout.readline(1)
    75         if output == '' and p.poll() is not None:
     74        output = p.stdout.readline(1).decode('utf-8')
     75        if output in ['', b''] and p.poll() is not None:
    7676            break
    7777        if output == '\n':
  • pyenvjasmine/tests/test_runner.py

    r26 r30  
    1414        success, stdout = jstests.run()
    1515        assert success
    16         # output is the resulting stdout from a subprocess call, which is a
    17         # bytes object, hence the b'' for the checks
    18         assert b'Failed: 0' in stdout
    19         assert b'Passed: 5' in stdout
     16        assert 'Failed: 0' in stdout
     17        assert 'Passed: 5' in stdout
    2018
    2119    def test_runner_params(self):
     
    3432        success, stdout = jstests.run(spec='tests/specs/test_demo.spec.js')
    3533        lines = stdout.splitlines()
    36         # output is the resulting stdout from a subprocess call, which is a
    37         # bytes object, hence the b'' in the endswith/startswith calls
    38         assert lines[0].endswith(b'specs/test_demo.spec.js')
    39         assert lines[1].startswith(b'[  Envjs/1.6 (Rhino;')
    40         assert b'Passed: 4' in lines
    41         assert b'Failed: 0' in lines
    42         assert b'Total : 4' in lines
     34        assert lines[0].endswith('specs/test_demo.spec.js')
     35        assert lines[1].startswith('[  Envjs/1.6 (Rhino;')
     36        assert 'Passed: 4' in lines
     37        assert 'Failed: 0' in lines
     38        assert 'Total : 4' in lines
    4339
    4440    def test_write_browser_htmlfile_markup_is_correct(self):
Note: See TracChangeset for help on using the changeset viewer.