Commit 0ddaed34 authored by Nick Coghlan's avatar Nick Coghlan

Close #19396: make test_contextlib tolerate -S

parent 7bad39f1
...@@ -636,10 +636,11 @@ class TestRedirectStdout(unittest.TestCase): ...@@ -636,10 +636,11 @@ class TestRedirectStdout(unittest.TestCase):
def test_redirect_to_string_io(self): def test_redirect_to_string_io(self):
f = io.StringIO() f = io.StringIO()
msg = "Consider an API like help(), which prints directly to stdout"
with redirect_stdout(f): with redirect_stdout(f):
help(pow) print(msg)
s = f.getvalue() s = f.getvalue().strip()
self.assertIn('pow', s) self.assertEqual(s, msg)
def test_enter_result_is_target(self): def test_enter_result_is_target(self):
f = io.StringIO() f = io.StringIO()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment