summaryrefslogtreecommitdiff
path: root/Lib/test/test_sys.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-08-19 17:18:12 +0000
committerVictor Stinner <victor.stinner@haypocalc.com>2010-08-19 17:18:12 +0000
commit515ca2047df4775b7471fd2a68a74eb88367ca2e (patch)
tree05f77f75fe09680daa76d7da095ac8c367cd00bb /Lib/test/test_sys.py
parent38430e2dffa3fd9d1648681f3b705917631bdc9a (diff)
downloadcpython-git-515ca2047df4775b7471fd2a68a74eb88367ca2e.tar.gz
test_main_invalid_unicode() of test_sys displays stderr on failure
Diffstat (limited to 'Lib/test/test_sys.py')
-rw-r--r--Lib/test/test_sys.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py
index eb50bbb40a..130aa66188 100644
--- a/Lib/test/test_sys.py
+++ b/Lib/test/test_sys.py
@@ -510,10 +510,9 @@ class SysModuleTest(unittest.TestCase):
p = subprocess.Popen([sys.executable, "-c", code], stderr=subprocess.PIPE)
stdout, stderr = p.communicate()
self.assertEqual(p.returncode, 1)
- lines = stderr.splitlines()
- self.assertGreaterEqual(len(lines), 2)
- self.assertEqual(b"Unable to decode the command from the command line:", lines[0])
- self.assertIn(br"UnicodeEncodeError:", lines[1])
+ pattern = b"Unable to decode the command from the command line:"
+ if not stderr.startswith(pattern):
+ raise AssertionError("%a doesn't start with %a" % (stderr, pattern))
def test_sys_flags(self):
self.assertTrue(sys.flags)