Exit pytest test session with custom exit code in different scenarios
