diff options
author | Steve Dower <steve.dower@microsoft.com> | 2018-02-17 18:59:03 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-17 18:59:03 -0800 |
commit | 01423cb53b5662b363d2f1a5963eadfe951ef3e8 (patch) | |
tree | 51d62aa19d6ff0d865080974fe8e0a2052ff1aaf /Lib/test/test_cmd_line.py | |
parent | d6ff8a7037903497eff95fa32bdac2b6adf71505 (diff) | |
download | cpython-git-01423cb53b5662b363d2f1a5963eadfe951ef3e8.tar.gz |
Improves the ability to build in CI (GH-5728)
Diffstat (limited to 'Lib/test/test_cmd_line.py')
-rw-r--r-- | Lib/test/test_cmd_line.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py index a6b663403f..fe89e3c0ee 100644 --- a/Lib/test/test_cmd_line.py +++ b/Lib/test/test_cmd_line.py @@ -63,6 +63,8 @@ class CmdLineTest(unittest.TestCase): rc, out, err = assert_python_ok('-vv') self.assertNotIn(b'stack overflow', err) + @unittest.skipIf(interpreter_requires_environment(), + 'Cannot run -E tests when PYTHON env vars are required.') def test_xoptions(self): def get_xoptions(*args): # use subprocess module directly because test.support.script_helper adds @@ -278,11 +280,7 @@ class CmdLineTest(unittest.TestCase): def test_displayhook_unencodable(self): for encoding in ('ascii', 'latin-1', 'utf-8'): - # We are testing a PYTHON environment variable here, so we can't - # use -E, -I, or script_helper (which uses them). So instead we do - # poor-man's isolation by deleting the PYTHON vars from env. - env = {key:value for (key,value) in os.environ.copy().items() - if not key.startswith('PYTHON')} + env = os.environ.copy() env['PYTHONIOENCODING'] = encoding p = subprocess.Popen( [sys.executable, '-i'], @@ -704,6 +702,8 @@ class CmdLineTest(unittest.TestCase): self.assertEqual(proc.returncode, 0, proc) +@unittest.skipIf(interpreter_requires_environment(), + 'Cannot run -I tests when PYTHON env vars are required.') class IgnoreEnvironmentTest(unittest.TestCase): def run_ignoring_vars(self, predicate, **env_vars): |