Always use the -E flag when spawning subprocesses in test_cmd_line (Issue 1056)
This commit is contained in:
parent
93bf9ce9b7
commit
1df42b118c
|
@ -4,7 +4,7 @@ import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
def _spawn_python(*args):
|
def _spawn_python(*args):
|
||||||
cmd_line = [sys.executable]
|
cmd_line = [sys.executable, '-E']
|
||||||
cmd_line.extend(args)
|
cmd_line.extend(args)
|
||||||
return subprocess.Popen(cmd_line, stdin=subprocess.PIPE,
|
return subprocess.Popen(cmd_line, stdin=subprocess.PIPE,
|
||||||
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||||
|
@ -24,7 +24,7 @@ class CmdLineTest(unittest.TestCase):
|
||||||
return _kill_python(p)
|
return _kill_python(p)
|
||||||
|
|
||||||
def exit_code(self, *args):
|
def exit_code(self, *args):
|
||||||
cmd_line = [sys.executable]
|
cmd_line = [sys.executable, '-E']
|
||||||
cmd_line.extend(args)
|
cmd_line.extend(args)
|
||||||
return subprocess.call(cmd_line, stdout=subprocess.PIPE,
|
return subprocess.call(cmd_line, stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE)
|
stderr=subprocess.PIPE)
|
||||||
|
@ -38,9 +38,6 @@ class CmdLineTest(unittest.TestCase):
|
||||||
self.assertTrue(data == '' or data.endswith('\n'))
|
self.assertTrue(data == '' or data.endswith('\n'))
|
||||||
self.assertTrue('Traceback' not in data)
|
self.assertTrue('Traceback' not in data)
|
||||||
|
|
||||||
def test_environment(self):
|
|
||||||
self.verify_valid_flag('-E')
|
|
||||||
|
|
||||||
def test_optimize(self):
|
def test_optimize(self):
|
||||||
self.verify_valid_flag('-O')
|
self.verify_valid_flag('-O')
|
||||||
self.verify_valid_flag('-OO')
|
self.verify_valid_flag('-OO')
|
||||||
|
|
Loading…
Reference in New Issue