[Python-checkins] cpython: test_regrtest: catch stderr in test_nowindows()
victor.stinner
python-checkins at python.org
Sun Oct 11 04:04:39 EDT 2015
https://hg.python.org/cpython/rev/df4ddecbc3a1
changeset: 98674:df4ddecbc3a1
user: Victor Stinner <victor.stinner at gmail.com>
date: Sun Oct 11 10:04:26 2015 +0200
summary:
test_regrtest: catch stderr in test_nowindows()
Check also that the deprecation warning is emited.
files:
Lib/test/test_regrtest.py | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py
--- a/Lib/test/test_regrtest.py
+++ b/Lib/test/test_regrtest.py
@@ -5,6 +5,7 @@
"""
import argparse
+import contextlib
import faulthandler
import getopt
import io
@@ -247,8 +248,11 @@
def test_nowindows(self):
for opt in '-n', '--nowindows':
with self.subTest(opt=opt):
- ns = libregrtest._parse_args([opt])
+ with contextlib.redirect_stderr(io.StringIO()) as stderr:
+ ns = libregrtest._parse_args([opt])
self.assertTrue(ns.nowindows)
+ err = stderr.getvalue()
+ self.assertIn('the --nowindows (-n) option is deprecated', err)
def test_forever(self):
for opt in '-F', '--forever':
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list