mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
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.
This commit is contained in:
parent
17d87f8ae4
commit
b9a3dd9dfb
4 changed files with 82 additions and 2 deletions
|
@ -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')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue