summaryrefslogtreecommitdiff
path: root/Lib/test/test_contextlib.py
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2013-10-26 16:37:47 +1000
committerNick Coghlan <ncoghlan@gmail.com>2013-10-26 16:37:47 +1000
commit247363a264545a9d7c657e6e31b82c34d0aa2278 (patch)
treef990f38988e4d73718cabd1c673db8b55293a74a /Lib/test/test_contextlib.py
parentd3757225b8fea0aad46defc5981008622ec6f951 (diff)
downloadcpython-247363a264545a9d7c657e6e31b82c34d0aa2278.tar.gz
Close #19396: make test_contextlib tolerate -S
Diffstat (limited to 'Lib/test/test_contextlib.py')
-rw-r--r--Lib/test/test_contextlib.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/test/test_contextlib.py b/Lib/test/test_contextlib.py
index e8d504d6e5..419104ddb0 100644
--- a/Lib/test/test_contextlib.py
+++ b/Lib/test/test_contextlib.py
@@ -636,10 +636,11 @@ class TestRedirectStdout(unittest.TestCase):
def test_redirect_to_string_io(self):
f = io.StringIO()
+ msg = "Consider an API like help(), which prints directly to stdout"
with redirect_stdout(f):
- help(pow)
- s = f.getvalue()
- self.assertIn('pow', s)
+ print(msg)
+ s = f.getvalue().strip()
+ self.assertEqual(s, msg)
def test_enter_result_is_target(self):
f = io.StringIO()