diff options
| author | Victor Stinner <victor.stinner@gmail.com> | 2016-01-18 11:15:08 (GMT) |
|---|---|---|
| committer | Victor Stinner <victor.stinner@gmail.com> | 2016-01-18 11:15:08 (GMT) |
| commit | 9def2843873edde3feec6eaf2ee60c4e48172164 (patch) | |
| tree | 9a7e862b8677c29fd877d55ea38b37d680087cfd /Lib/test/test_inspect.py | |
| parent | c437d0cb4e99bd58ff0150414b5d5f0b26605687 (diff) | |
| download | cpython-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_inspect.py')
| -rw-r--r-- | Lib/test/test_inspect.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py index 283c922..422a3d6 100644 --- a/Lib/test/test_inspect.py +++ b/Lib/test/test_inspect.py @@ -30,6 +30,7 @@ from test.support import MISSING_C_DOCSTRINGS, cpython_only from test.support.script_helper import assert_python_ok, assert_python_failure from test import inspect_fodder as mod from test import inspect_fodder2 as mod2 +from test import support from test.test_import import _ready_to_import @@ -3536,14 +3537,14 @@ class TestMain(unittest.TestCase): def test_details(self): module = importlib.import_module('unittest') - rc, out, err = assert_python_ok('-m', 'inspect', + args = support.optim_args_from_interpreter_flags() + rc, out, err = assert_python_ok(*args, '-m', 'inspect', 'unittest', '--details') output = out.decode() # Just a quick sanity check on the output self.assertIn(module.__name__, output) self.assertIn(module.__file__, output) - if not sys.flags.optimize: - self.assertIn(module.__cached__, output) + self.assertIn(module.__cached__, output) self.assertEqual(err, b'') |
