Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(86197)

Unified Diff: Lib/test/test_faulthandler.py

Issue 23670: Modifications to support iOS as a development platform
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Lib/test/test_doctest.py ('k') | Lib/test/test_fcntl.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/test/test_faulthandler.py Tue Mar 01 10:26:10 2016 +0200
+++ b/Lib/test/test_faulthandler.py Wed Mar 02 00:01:35 2016 +0000
@@ -277,40 +277,43 @@ class FaultHandlerTests(unittest.TestCas
finally:
if was_enabled:
faulthandler.enable()
else:
faulthandler.disable()
finally:
sys.stderr = orig_stderr
+ @unittest.skipUnless(hasattr(subprocess, 'Popen'), "test requires subprocess.Popen()")
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)
# don't use assert_python_ok() because it always enables faulthandler
output = subprocess.check_output(args, env=env)
self.assertEqual(output.rstrip(), b"False")
+ @unittest.skipUnless(hasattr(subprocess, 'Popen'), "test requires subprocess.Popen()")
def test_sys_xoptions(self):
# Test python -X faulthandler
code = "import faulthandler; print(faulthandler.is_enabled())"
args = filter(None, (sys.executable,
"-E" if sys.flags.ignore_environment else "",
"-X", "faulthandler", "-c", code))
env = os.environ.copy()
env.pop("PYTHONFAULTHANDLER", None)
# don't use assert_python_ok() because it always enables faulthandler
output = subprocess.check_output(args, env=env)
self.assertEqual(output.rstrip(), b"True")
+ @unittest.skipUnless(hasattr(subprocess, 'Popen'), "test requires subprocess.Popen()")
def test_env_var(self):
# empty env var
code = "import faulthandler; print(faulthandler.is_enabled())"
args = (sys.executable, "-c", code)
env = os.environ.copy()
env['PYTHONFAULTHANDLER'] = ''
# don't use assert_python_ok() because it always enables faulthandler
output = subprocess.check_output(args, env=env)
« no previous file with comments | « Lib/test/test_doctest.py ('k') | Lib/test/test_fcntl.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+