diff options
Diffstat (limited to 'Lib/test/test_support.py')
| -rw-r--r-- | Lib/test/test_support.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py index 171e28a..4a8f3c5 100644 --- a/Lib/test/test_support.py +++ b/Lib/test/test_support.py @@ -456,7 +456,7 @@ class TestSupport(unittest.TestCase): # pending child process support.reap_children() - def check_options(self, args, func): + def check_options(self, args, func, expected=None): code = f'from test.support import {func}; print(repr({func}()))' cmd = [sys.executable, *args, '-c', code] env = {key: value for key, value in os.environ.items() @@ -466,7 +466,9 @@ class TestSupport(unittest.TestCase): stderr=subprocess.DEVNULL, universal_newlines=True, env=env) - self.assertEqual(proc.stdout.rstrip(), repr(args)) + if expected is None: + expected = args + self.assertEqual(proc.stdout.rstrip(), repr(expected)) self.assertEqual(proc.returncode, 0) def test_args_from_interpreter_flags(self): @@ -482,6 +484,7 @@ class TestSupport(unittest.TestCase): ['-v'], ['-b'], ['-q'], + ['-I'], # same option multiple times ['-bb'], ['-vvv'], @@ -500,6 +503,9 @@ class TestSupport(unittest.TestCase): with self.subTest(opts=opts): self.check_options(opts, 'args_from_interpreter_flags') + self.check_options(['-I', '-E', '-s'], 'args_from_interpreter_flags', + ['-I']) + def test_optim_args_from_interpreter_flags(self): # Test test.support.optim_args_from_interpreter_flags() for opts in ( |
