summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2009-07-08 15:09:12 -0400
committerNed Batchelder <ned@nedbatchelder.com>2009-07-08 15:09:12 -0400
commit1b1ec1268f147344d05588f6fc5a0902f68d995d (patch)
treeea571046475ce37a6520669ce532d122cf13e631 /test
parenta13a2c89da9bbe9cabc54af293c8c73339cc268a (diff)
downloadpython-coveragepy-git-1b1ec1268f147344d05588f6fc5a0902f68d995d.tar.gz
Py3k: bytes vs. strings, and one more print statement.
Diffstat (limited to 'test')
-rw-r--r--test/test_execfile.py4
-rw-r--r--test/test_farm.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/test/test_execfile.py b/test/test_execfile.py
index 9c838e1a..aee4eeb3 100644
--- a/test/test_execfile.py
+++ b/test/test_execfile.py
@@ -49,10 +49,10 @@ class RunTest(CoverageTest):
def test_universal_newlines(self):
# Make sure we can read any sort of line ending.
- pylines = """# try newlines|print 'Hello, world!'|""".split('|')
+ pylines = """# try newlines|print('Hello, world!')|""".split('|')
for nl in ('\n', '\r\n', '\r'):
fpy = open('nl.py', 'wb')
- fpy.write(nl.join(pylines))
+ fpy.write(nl.join(pylines).encode('utf-8'))
fpy.close()
run_python_file('nl.py', ['nl.py'])
self.assertEqual(self.stdout(), "Hello, world!\n"*3)
diff --git a/test/test_farm.py b/test/test_farm.py
index 4323f23c..d7b40b33 100644
--- a/test/test_farm.py
+++ b/test/test_farm.py
@@ -134,7 +134,7 @@ class FarmTestCase(object):
retcode, output = run_command(cmd)
print output,
if outfile:
- open(outfile, "a+").write(output)
+ open(outfile, "a+").write(output.decode('utf-8'))
if retcode:
raise Exception("command exited abnormally")
finally: