[Python-checkins] cpython (3.6): Issue #28226: Fix test_compileall on Windows
berker.peksag
python-checkins at python.org
Fri Sep 30 19:42:54 EDT 2016
https://hg.python.org/cpython/rev/13cd90bdcfbe
changeset: 104202:13cd90bdcfbe
branch: 3.6
parent: 104200:a1e7c9d249ed
user: Berker Peksag <berker.peksag at gmail.com>
date: Sat Oct 01 02:44:37 2016 +0300
summary:
Issue #28226: Fix test_compileall on Windows
files:
Lib/test/test_compileall.py | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Lib/test/test_compileall.py b/Lib/test/test_compileall.py
--- a/Lib/test/test_compileall.py
+++ b/Lib/test/test_compileall.py
@@ -107,8 +107,7 @@
# 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 @@
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')
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list