mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
bpo-32101: Fix tests for PYTHONDEVMODE=1 (#4821)
test_asycio: remove also aio_path which was used when asyncio was developed outside the stdlib.
This commit is contained in:
parent
747f48e2e9
commit
721e25c653
3 changed files with 16 additions and 17 deletions
|
|
@ -332,13 +332,9 @@ class FaultHandlerTests(unittest.TestCase):
|
|||
def test_disabled_by_default(self):
|
||||
# By default, the module should be disabled
|
||||
code = "import faulthandler; print(faulthandler.is_enabled())"
|
||||
args = filter(None, (sys.executable,
|
||||
"-E" if sys.flags.ignore_environment else "",
|
||||
"-c", code))
|
||||
env = os.environ.copy()
|
||||
env.pop("PYTHONFAULTHANDLER", None)
|
||||
args = (sys.executable, "-E", "-c", code)
|
||||
# don't use assert_python_ok() because it always enables faulthandler
|
||||
output = subprocess.check_output(args, env=env)
|
||||
output = subprocess.check_output(args)
|
||||
self.assertEqual(output.rstrip(), b"False")
|
||||
|
||||
def test_sys_xoptions(self):
|
||||
|
|
@ -357,15 +353,17 @@ class FaultHandlerTests(unittest.TestCase):
|
|||
# empty env var
|
||||
code = "import faulthandler; print(faulthandler.is_enabled())"
|
||||
args = (sys.executable, "-c", code)
|
||||
env = os.environ.copy()
|
||||
env = dict(os.environ)
|
||||
env['PYTHONFAULTHANDLER'] = ''
|
||||
env['PYTHONDEVMODE'] = ''
|
||||
# don't use assert_python_ok() because it always enables faulthandler
|
||||
output = subprocess.check_output(args, env=env)
|
||||
self.assertEqual(output.rstrip(), b"False")
|
||||
|
||||
# non-empty env var
|
||||
env = os.environ.copy()
|
||||
env = dict(os.environ)
|
||||
env['PYTHONFAULTHANDLER'] = '1'
|
||||
env['PYTHONDEVMODE'] = ''
|
||||
output = subprocess.check_output(args, env=env)
|
||||
self.assertEqual(output.rstrip(), b"True")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue