The only significant change was adding main_args to run_main_program(test_script_path=None, main_args=None), which has the same default behaviour, but if the args are passed in then it uses those instead of sys.argv.
I also added the argument parser build into its own function, and deglobalised parser.
Steps were being taken in this direction elsewhere, but it was quick enough to try out and make sure things don't break.
Proof of concept... let test scripts act as their own runner.
The only significant change was adding
main_args
torun_main_program(test_script_path=None, main_args=None)
, which has the same default behaviour, but if the args are passed in then it uses those instead ofsys.argv
.I also added the argument parser build into its own function, and deglobalised
parser
.Steps were being taken in this direction elsewhere, but it was quick enough to try out and make sure things don't break.