How to reinitialise an embedded Python interpreter?

前端 未结 3 1087
一向
一向 2021-02-04 13:06

I\'m working on embedding Python in our test suite application. The purpose is to use Python to run several tests scripts to collect data and make a report of tests. Multiple te

3条回答
  •  我在风中等你
    2021-02-04 13:29

    I'd write another shell script executing the sequence of test scripts with new instances of python each time. Or write it in python like

    # run your tests in the process first
    # now run the user scripts, each in new process to have virgin env
    for script in userScript:
        subprocess.call(['python',script])
    

提交回复
热议问题