Open nick-youngblut opened 4 years ago
I tried to reproduce this with the following test:
@pytest.mark.script_launch_mode('both')
def test_subprocess(console_script, script_runner):
console_script.write(
"""
import subprocess
res = subprocess.run(['echo', 'foo'], stdout=subprocess.PIPE)
print(res.returncode)
print(res.stdout.decode('utf-8'))
"""
)
result = script_runner.run(str(console_script))
assert result.success
assert result.stdout == '0\nfoo\n\n'
It passes, as expected. Can you construct an example of your behavior please, then I could investigate further.
I am trying to test a console script that itself runs calls
subprocess
a few times in the script. These subprocess calls are just skipped when usingpytest-console-scripts-0.2.0
. The rest of the console script, but it simply bypasses thesubprocess
calls. I don't see anything about this in thepytest-console-scripts
docs.