So I have a directory filled with a bunch of tests written in python with the proper syntax to make sure they run in order.
So let's say I have a test which if fails, currently calls pytest.exit('Exit Message'). The problem with this is that the generated test output in XML only records the tests preceding it. I would prefer that the whole suite is run but are reported as failed if the test mentioned above fails.
A solution I thought of was setting an environment variable in case it fails and then checking that environment variable in the following tests. The issue is that running it with Jenkins, the environment variable set isn't detected and I would prefer a native solution if it exists.
What I have is:
def test_check_connection(self):
...
if Failed:
pytest.exit('No connectivity')