Skip to content

Commit 2d7d06d

Browse files
committed
Use support.captured_stdout() and move assertions out of context per review
1 parent 55a87b8 commit 2d7d06d

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎Lib/test/test_filecmp.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -527,12 +527,12 @@ def fake_private_cmp(a, b, sh):
527527
_ = dc.subdirs
528528
dc.phase4_closure()
529529

530-
with patch("sys.stdout", new=io.StringIO()) as mock_stdout:
530+
with support.captured_stdout() as mock_stdout:
531531
dc.report()
532-
output = mock_stdout.getvalue()
533-
534-
self.assertIn("Common funny cases", output)
535-
self.assertIn("Trouble with common files", output)
532+
533+
output = mock_stdout.getvalue()
534+
self.assertIn("Common funny cases", output)
535+
self.assertIn("Trouble with common files", output)
536536

537537

538538
if __name__ == "__main__":

0 commit comments

Comments
 (0)