From 9c92a691e1f0f889fffd22a48d02ceaea38c05c6 Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Sun, 5 Aug 2012 00:33:10 +0200 Subject: [PATCH] Fix test_venv to work with universal newlines (issue #13119) --- Lib/test/test_venv.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Lib/test/test_venv.py b/Lib/test/test_venv.py index b1b831e3a3d..96968444c60 100644 --- a/Lib/test/test_venv.py +++ b/Lib/test/test_venv.py @@ -111,7 +111,7 @@ class BasicTest(BaseTest): p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) out, err = p.communicate() - self.assertEqual(out[:-1], expected.encode()) + self.assertEqual(out.strip(), expected.encode()) def test_overwrite_existing(self): """ @@ -179,7 +179,7 @@ class BasicTest(BaseTest): p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) out, err = p.communicate() - self.assertEqual(out[:-1], envpy.encode()) + self.assertEqual(out.strip(), envpy.encode()) @unittest.skipUnless(can_symlink(), 'Needs symlinks') def test_executable_symlinks(self): @@ -194,7 +194,7 @@ class BasicTest(BaseTest): p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) out, err = p.communicate() - self.assertEqual(out[:-1], envpy.encode()) + self.assertEqual(out.strip(), envpy.encode()) def test_main(): run_unittest(BasicTest)