return ' '.join(args)
+def python_cmd():
+ cmd = [sys.executable]
+ cmd.extend(subprocess._args_from_interpreter_flags())
+ cmd.extend(subprocess._optim_args_from_interpreter_flags())
+ return cmd
+
+
def list_cases(args):
- cmd = [sys.executable, '-m', 'test', '--list-cases']
+ cmd = python_cmd()
+ cmd.extend(['-m', 'test', '--list-cases'])
cmd.extend(args.test_args)
proc = subprocess.run(cmd,
stdout=subprocess.PIPE,
try:
write_tests(tmp, tests)
- cmd = [sys.executable, '-m', 'test', '--matchfile', tmp]
+ cmd = python_cmd()
+ cmd.extend(['-m', 'test', '--matchfile', tmp])
cmd.extend(args.test_args)
print("+ %s" % format_shell_args(cmd))
proc = subprocess.run(cmd)
def main():
args = parse_args()
+ if '-w' in args.test_args or '--verbose2' in args.test_args:
+ print("WARNING: -w/--verbose2 option should not be used to bisect!")
+ print()
if args.input:
with open(args.input) as fp:
--- /dev/null
+``test.bisect_cmd`` now copies Python command line options like ``-O`` or
+``-W``. Moreover, emit a warning if ``test.bisect_cmd`` is used with
+``-w``/``--verbose2`` option.