For a python pytest file with contents of:
import os
def test_that():
print("step 1: should work")
os.system("echo hello")
print("step 2: should fail")
os.system("asdf_failing_non_existing_command")
and an invocation of pytest like:
pytest -s testing.py
The output is:
1 passed
I would expect the test to fail. How can I get the exit code from os system call to influence the test failure and actually fail the test?