summaryrefslogtreecommitdiff
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
commit7020d627529a84fd11de6abc61188e83efbe001c (patch)
tree4c46c0f5c01bdbf4c5ca6c73ce281acba10297e6
parenta4657384385e82ac77e5c4f6b28df664da7dac51 (diff)
downloadpython-coveragepy-7020d627529a84fd11de6abc61188e83efbe001c.tar.gz
Py3k: bytes vs. strings, and one more print statement.
-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 9c838e1..aee4eeb 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 4323f23..d7b40b3 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: