mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
gh-114075: Capture test_compileall stdout output (#114076)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
parent
f8a79109d0
commit
892155d736
1 changed files with 3 additions and 1 deletions
|
|
@ -369,7 +369,9 @@ def test_strip_only_invalid(self):
|
|||
script = script_helper.make_script(path, "test", "1 / 0")
|
||||
bc = importlib.util.cache_from_source(script)
|
||||
stripdir = os.path.join(self.directory, *(fullpath[:2] + ['fake']))
|
||||
compileall.compile_dir(path, quiet=True, stripdir=stripdir)
|
||||
with support.captured_stdout() as out:
|
||||
compileall.compile_dir(path, quiet=True, stripdir=stripdir)
|
||||
self.assertIn("not a valid prefix", out.getvalue())
|
||||
rc, out, err = script_helper.assert_python_failure(bc)
|
||||
expected_not_in = os.path.join(self.directory, *fullpath[2:])
|
||||
self.assertIn(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue