Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Commit

Permalink
fix python3 (?)
Browse files Browse the repository at this point in the history
  • Loading branch information
Buck Golemon committed Nov 11, 2014
1 parent 47b9e47 commit f7caf3b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions tests/functional/simple_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
TOP = Path(__file__) / '../../..'
SCENARIOS = TOP/'tests/scenarios'

from sys import builtin_module_names
from sys import version_info, builtin_module_names
PY33 = (version_info >= (3, 3))
PYPY = ('__pypy__' in builtin_module_names)


Expand Down Expand Up @@ -68,7 +69,11 @@ def test_arguments_version(capfd):
assert excinfo.value.returncode == 1
out, err = capfd.readouterr()
lasterr = strip_coverage_warnings(err).rsplit('\n', 2)[-2]
assert lasterr == 'OSError: [Errno 2] No such file or directory', err
if PY33:
errname = 'FileNotFoundError'
else:
errname = 'OSError'
assert lasterr == errname + ': [Errno 2] No such file or directory', err

lines = out.split('\n')
assert lines[-3] == ('> virtualenv virtualenv_run --version'), out
Expand Down Expand Up @@ -195,8 +200,9 @@ def pipe_output(read, write):

from os import fdopen
fdopen(write, 'w').close()
with fdopen(read) as output:
result = output.read()
read = fdopen(read)
result = read.read()
read.close()
vupdate.wait()
return result

Expand Down

0 comments on commit f7caf3b

Please sign in to comment.