summaryrefslogtreecommitdiffstats
path: root/Lib/unittest/test/test_runner.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-12-12 21:59:48 (GMT)
committerGitHub <noreply@github.com>2017-12-12 21:59:48 (GMT)
commit747f48e2e92390c44c72f52a1239959601cde157 (patch)
tree502e53b129aee7a393ca6d05e4f93751919a5e1b /Lib/unittest/test/test_runner.py
parentb748e3b2586e44bfc7011b601bce9cc6d16d89f1 (diff)
downloadcpython-747f48e2e92390c44c72f52a1239959601cde157.zip
cpython-747f48e2e92390c44c72f52a1239959601cde157.tar.gz
cpython-747f48e2e92390c44c72f52a1239959601cde157.tar.bz2
bpo-32230: Set sys.warnoptions with -X dev (#4820)
Rather than supporting dev mode directly in the warnings module, this instead adjusts the initialisation code to add an extra 'default' entry to sys.warnoptions when dev mode is enabled. This ensures that dev mode behaves *exactly* as if `-Wdefault` had been passed on the command line, including in the way it interacts with `sys.warnoptions`, and with other command line flags like `-bb`. Fix also bpo-20361: have -b & -bb options take precedence over any other warnings options. Patch written by Nick Coghlan, with minor modifications of Victor Stinner.
Diffstat (limited to 'Lib/unittest/test/test_runner.py')
-rw-r--r--Lib/unittest/test/test_runner.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/unittest/test/test_runner.py b/Lib/unittest/test/test_runner.py
index ddc498c..3c40056 100644
--- a/Lib/unittest/test/test_runner.py
+++ b/Lib/unittest/test/test_runner.py
@@ -289,7 +289,7 @@ class Test_TextTestRunner(unittest.TestCase):
at_msg = b'Please use assertTrue instead.'
# no args -> all the warnings are printed, unittest warnings only once
- p = subprocess.Popen([sys.executable, '_test_warnings.py'], **opts)
+ p = subprocess.Popen([sys.executable, '-E', '_test_warnings.py'], **opts)
with p:
out, err = get_parse_out_err(p)
self.assertIn(b'OK', err)