I am running my python selenium test script in parallel using pytest. I want to stop entire test suit execution if certain condition becomes true in any of the test case? Do we have any functions or methods to do so?
I tried with sys.exit(), pytest.exit(), raising keyboard interrupt exception but all these will only stop current test case and move on to the next test case. I can't use pytest -x or pytest --maxfail=1 since testcase might also fail for some other reasons but not for particular condition which i am expecting to fail.