How do I mark a test as failed with Pytest?

How do I mark a test as failed with Pytest?

Hey Helen,

To mark a test as Fail on LambdaTest, you need to use Lambda Hooks as given below:

browser.execute_script("lambda-status=failed")

You can also refer the below documentation: