Merge pull request #603 from stinos/windows-tests-newline

tests: Fix handling of newlines from expected output files on windows
This commit is contained in:
Damien George 2014-05-11 15:03:57 +01:00
commit c3dcb590b8
1 changed files with 3 additions and 1 deletions

View File

@ -44,8 +44,10 @@ def run_tests(pyb, tests):
# expected output given by a file, so read that in # expected output given by a file, so read that in
with open(test_file_expected, 'rb') as f: with open(test_file_expected, 'rb') as f:
output_expected = f.read() output_expected = f.read()
if os.name == 'nt':
output_expected = output_expected.replace(b'\n', b'\r\n')
else: else:
# run CPython to work out expeceted output # run CPython to work out expected output
try: try:
output_expected = subprocess.check_output([CPYTHON3, '-B', test_file]) output_expected = subprocess.check_output([CPYTHON3, '-B', test_file])
except subprocess.CalledProcessError: except subprocess.CalledProcessError: