summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_cmd_line_script.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-01-18 11:15:08 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2016-01-18 11:15:08 (GMT)
commit9def2843873edde3feec6eaf2ee60c4e48172164 (patch)
tree9a7e862b8677c29fd877d55ea38b37d680087cfd /Lib/test/test_cmd_line_script.py
parentc437d0cb4e99bd58ff0150414b5d5f0b26605687 (diff)
downloadcpython-9def2843873edde3feec6eaf2ee60c4e48172164.zip
cpython-9def2843873edde3feec6eaf2ee60c4e48172164.tar.gz
cpython-9def2843873edde3feec6eaf2ee60c4e48172164.tar.bz2
subprocess._optim_args_from_interpreter_flags()
Issue #26100: * Add subprocess._optim_args_from_interpreter_flags() * Add test.support.optim_args_from_interpreter_flags() * Use new functions in distutils, test_cmd_line_script, test_compileall and test_inspect The change enables test_details() test of test_inspect when -O or -OO command line option is used.
Diffstat (limited to 'Lib/test/test_cmd_line_script.py')
-rw-r--r--Lib/test/test_cmd_line_script.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/test/test_cmd_line_script.py b/Lib/test/test_cmd_line_script.py
index afac62a..9398040 100644
--- a/Lib/test/test_cmd_line_script.py
+++ b/Lib/test/test_cmd_line_script.py
@@ -138,9 +138,8 @@ class CmdLineTest(unittest.TestCase):
expected_argv0, expected_path0,
expected_package, expected_loader,
*cmd_line_switches):
- if not __debug__:
- cmd_line_switches += ('-' + 'O' * sys.flags.optimize,)
- run_args = cmd_line_switches + (script_name,) + tuple(example_args)
+ run_args = [*support.optim_args_from_interpreter_flags(),
+ *cmd_line_switches, script_name, *example_args]
rc, out, err = assert_python_ok(*run_args, __isolated=False)
self._check_output(script_name, rc, out + err, expected_file,
expected_argv0, expected_path0,