diff options
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_cmd_line_script.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_cmd_line_script.py b/Lib/test/test_cmd_line_script.py index 75e9f8d..bd34392 100644 --- a/Lib/test/test_cmd_line_script.py +++ b/Lib/test/test_cmd_line_script.py @@ -1,6 +1,7 @@ # tests command line execution of scripts import unittest +import sys import os import os.path import py_compile @@ -97,6 +98,8 @@ class CmdLineTest(unittest.TestCase): expected_argv0, expected_path0, expected_package, *cmd_line_switches): + if not __debug__: + cmd_line_switches += ('-' + 'O' * sys.flags.optimize,) run_args = cmd_line_switches + (script_name,) rc, out, err = assert_python_ok(*run_args) self._check_output(script_name, rc, out + err, expected_file, |