In one of my functions I’m calling an external program, using subprocess.check_call, which will produce output. How could I use doctest to make sure the output it’s producing is the one I’m expecting?
In one of my functions I’m calling an external program, using subprocess.check_call , which
Share
Maybe this can help:
As you can see i used the argument
stdoutof thesubprocess.check_callfunction so to be able to get the output of the command , beside that if you are not using thestdoutargument (which i assume that is your case) i think it very hard to capture the command output.Hope this was hopeful 🙂