mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Close #19396: make test_contextlib tolerate -S
This commit is contained in:
parent
7bad39f174
commit
0ddaed3456
1 changed files with 4 additions and 3 deletions
|
@ -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()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue