android - Execute code if a test fails with py.test -
I am using UI Test Automation on Android. I want to be able to save a bug report after the test failed.
Is there any way that if a test has failed in my test code, can I save the bug report in Tidown after that?
Basically, I just wanted to save the bug report after each trial, but it is slightly more in adding 45 seconds to each test.
You can apply your > pytest_runtest_logreport in conftest.py like this: For more information, see. code
def pytest_runtest_logreport (report): if report. When == 'Call' and report.failed: # Save bug report
Comments
Post a Comment