How can I access the overall test result of a pytest test run during runtime?
问题 Dependent on the overall test result of a pytest test run I would like to execute conditional tear down. This means the access to the overall test result must happen after all tests have been executed but before the test runner has been left. How can I achieve this? 回答1: I could not find a suitable pytest hook to access the overall test result yet. You don't need one; just collect the test results yourself. This is the blueprint I usually use when in need of accessing the test results in