summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_cmd_line.py
diff options
context:
space:
mode:
authorGregory P. Smith <greg@krypto.org>2015-02-04 09:04:31 (GMT)
committerGregory P. Smith <greg@krypto.org>2015-02-04 09:04:31 (GMT)
commit8f2fae1e7d7142a280a23bb9428d0aaddbb518c5 (patch)
treef53026d0eb093df250a19cd2dd8d80ba5587ebed /Lib/test/test_cmd_line.py
parenta7559c04e09980a3ae468a996609805dfe413ca4 (diff)
parentb9a3dd9dfb780b9691f8a1859fd67cf9eadbd2d0 (diff)
downloadcpython-8f2fae1e7d7142a280a23bb9428d0aaddbb518c5.zip
cpython-8f2fae1e7d7142a280a23bb9428d0aaddbb518c5.tar.gz
cpython-8f2fae1e7d7142a280a23bb9428d0aaddbb518c5.tar.bz2
Skip some tests that require a subinterpreter launched with -E or -I when the
interpreter under test is being run in an environment that requires the use of environment variables such as PYTHONHOME in order to function at all. Adds a test.script_helper.interpreter_requires_environment() function to be used with @unittest.skipIf on stdlib test methods requiring this.
Diffstat (limited to 'Lib/test/test_cmd_line.py')
-rw-r--r--Lib/test/test_cmd_line.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py
index 327c145..ebe557e 100644
--- a/Lib/test/test_cmd_line.py
+++ b/Lib/test/test_cmd_line.py
@@ -8,6 +8,7 @@ import shutil
import sys
import subprocess
import tempfile
+from test import script_helper
from test.script_helper import (spawn_python, kill_python, assert_python_ok,
assert_python_failure)
@@ -439,7 +440,8 @@ class CmdLineTest(unittest.TestCase):
self.assertEqual(err.splitlines().count(b'Unknown option: -a'), 1)
self.assertEqual(b'', out)
-
+ @unittest.skipIf(script_helper.interpreter_requires_environment(),
+ 'Cannot run -I tests when PYTHON env vars are required.')
def test_isolatedmode(self):
self.verify_valid_flag('-I')
self.verify_valid_flag('-IEs')