diff options
author | Gregory P. Smith <greg@krypto.org> | 2015-02-04 08:59:40 (GMT) |
---|---|---|
committer | Gregory P. Smith <greg@krypto.org> | 2015-02-04 08:59:40 (GMT) |
commit | b9a3dd9dfb780b9691f8a1859fd67cf9eadbd2d0 (patch) | |
tree | c186f9c50fd386da260b0c345550df9f0a65ac81 /Lib/test/test_cmd_line.py | |
parent | 17d87f8ae42122025b5ce41230df6ba9e042ec40 (diff) | |
download | cpython-b9a3dd9dfb780b9691f8a1859fd67cf9eadbd2d0.zip cpython-b9a3dd9dfb780b9691f8a1859fd67cf9eadbd2d0.tar.gz cpython-b9a3dd9dfb780b9691f8a1859fd67cf9eadbd2d0.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 private 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.py | 4 |
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..3683a48 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') |