Try again to fix test_warnings on Windows
authorVictor Stinner <victor.stinner@gmail.com>
Sat, 19 Mar 2016 09:00:08 +0000 (10:00 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Sat, 19 Mar 2016 09:00:08 +0000 (10:00 +0100)
Issue #26567: normalize newlines in test_tracemalloc.

Lib/test/test_warnings/__init__.py

index be80b05402adbdc1a278573b8ccc71d6265b5779..e6f47cda4c3dc0feb867c56920fd7df5d696d8eb 100644 (file)
@@ -788,6 +788,8 @@ class PyWarningsDisplayTests(WarningsDisplayTests, unittest.TestCase):
         res = assert_python_ok('-Wd', '-X', 'tracemalloc=2', support.TESTFN)
 
         stderr = res.err.decode('ascii', 'replace')
+        # normalize newlines
+        stderr = '\n'.join(stderr.splitlines())
         stderr = re.sub('<.*>', '<...>', stderr)
         expected = textwrap.dedent('''
             {fname}:5: ResourceWarning: unclosed file <...>