diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-10-11 08:04:26 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-10-11 08:04:26 (GMT) |
commit | 14b4662e18189132e343781070290bf5729452b5 (patch) | |
tree | 5f1ab3ea08a215d7a4b1c9be0c00e7bb128abc31 /Lib/test/test_regrtest.py | |
parent | 4967146c8d6f68480c5ca4ed73940607dd1d9286 (diff) | |
download | cpython-14b4662e18189132e343781070290bf5729452b5.zip cpython-14b4662e18189132e343781070290bf5729452b5.tar.gz cpython-14b4662e18189132e343781070290bf5729452b5.tar.bz2 |
test_regrtest: catch stderr in test_nowindows()
Check also that the deprecation warning is emited.
Diffstat (limited to 'Lib/test/test_regrtest.py')
-rw-r--r-- | 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 index 0f00698..16a29b1 100644 --- a/Lib/test/test_regrtest.py +++ b/Lib/test/test_regrtest.py @@ -5,6 +5,7 @@ Note: test_regrtest cannot be run twice in parallel. """ import argparse +import contextlib import faulthandler import getopt import io @@ -247,8 +248,11 @@ class ParseArgsTestCase(unittest.TestCase): 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': |