]> granicus.if.org Git - python/commitdiff
Issue #28226: Fix test_compileall on Windows
authorBerker Peksag <berker.peksag@gmail.com>
Fri, 30 Sep 2016 23:44:37 +0000 (02:44 +0300)
committerBerker Peksag <berker.peksag@gmail.com>
Fri, 30 Sep 2016 23:44:37 +0000 (02:44 +0300)
Lib/test/test_compileall.py

index 30ca3feee404d59c7e949d2e99a73e1b72d69b41..2356efcaec78bebb5d1c06284e1e9aca63af8ee9 100644 (file)
@@ -107,8 +107,7 @@ class CompileallTests(unittest.TestCase):
         # we should also test the output
         with support.captured_stdout() as stdout:
             self.assertTrue(compileall.compile_file(pathlib.Path(self.source_path)))
-        self.assertEqual(stdout.getvalue(),
-                         "Compiling '{}'...\n".format(self.source_path))
+        self.assertRegex(stdout.getvalue(), r'Compiling ([^WindowsPath|PosixPath].*)')
         self.assertTrue(os.path.isfile(self.bc_path))
 
     def test_compile_file_pathlike_ddir(self):
@@ -158,7 +157,8 @@ class CompileallTests(unittest.TestCase):
         self.assertFalse(os.path.isfile(self.bc_path))
         with support.captured_stdout() as stdout:
             compileall.compile_dir(pathlib.Path(self.directory))
-        self.assertIn("Listing '{}'...".format(self.directory), stdout.getvalue())
+        line = stdout.getvalue().splitlines()[0]
+        self.assertRegex(line, r'Listing ([^WindowsPath|PosixPath].*)')
         self.assertTrue(os.path.isfile(self.bc_path))
 
     @mock.patch('compileall.ProcessPoolExecutor')