Commit c2c20287 authored by Fantix King's avatar Fantix King Committed by Denis Bilenko

Fixed subprocess tests.

parent 77345daa
......@@ -64,12 +64,12 @@ class Test(greentest.TestCase):
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
(stdout, stderr) = p.communicate("banana")
self.assertEqual(stdout, "banana")
(stdout, stderr) = p.communicate(b"banana")
self.assertEqual(stdout, b"banana")
if sys.executable.endswith('-dbg'):
assert stderr.startswith('pineapple')
assert stderr.startswith(b'pineapple')
else:
self.assertEqual(stderr, "pineapple")
self.assertEqual(stderr, b"pineapple")
def test_universal1(self):
p = subprocess.Popen([sys.executable, "-c",
......@@ -96,7 +96,7 @@ class Test(greentest.TestCase):
else:
# Interpreter without universal newline support
self.assertEqual(stdout,
"line1\nline2\rline3\r\nline4\r\nline5\nline6")
b"line1\nline2\rline3\r\nline4\r\nline5\nline6")
finally:
p.stdout.close()
......@@ -123,7 +123,7 @@ class Test(greentest.TestCase):
else:
# Interpreter without universal newline support
self.assertEqual(stdout,
"line1\nline2\rline3\r\nline4\r\nline5\nline6")
b"line1\nline2\rline3\r\nline4\r\nline5\nline6")
finally:
p.stdout.close()
......
......@@ -12,7 +12,7 @@ else:
import subprocess
for _ in xrange(5):
out, err = subprocess.Popen([sys.executable, __file__, 'runtestcase'], stderr=subprocess.PIPE).communicate()
if 'refs' in err:
assert err.startswith('bye'), repr(err)
if b'refs' in err:
assert err.startswith(b'bye'), repr(err)
else:
assert err.strip() == 'bye', repr(err)
assert err.strip() == b'bye', repr(err)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment