Skip to content

Commit fadcd44

Browse files
authored
test_tools: catch stderr (GH-7404)
Hide "recursedown('@test_9296_tmp')" message.
1 parent a30d587 commit fadcd44

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

Lib/test/test_tools.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,12 +416,15 @@ def test_directory(self):
416416
with open(os.path.join(test_support.TESTFN, "file.py"), "w") as file:
417417
file.write("xx = 'unaltered'\n")
418418
script = os.path.join(scriptsdir, "fixcid.py")
419-
output = self.run_script(args=(test_support.TESTFN,))
419+
# ignore dbg() messages
420+
with test_support.captured_stderr() as stderr:
421+
output = self.run_script(args=(test_support.TESTFN,))
420422
self.assertMultiLineEqual(output,
421423
"{}:\n"
422424
"1\n"
423425
'< int xx;\n'
424-
'> int yy;\n'.format(c_filename)
426+
'> int yy;\n'.format(c_filename),
427+
"stderr: %s" % stderr.getvalue()
425428
)
426429

427430
def run_script(self, input="", args=("-",), substfile="xx yy\n"):

0 commit comments

Comments
 (0)