mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 14:35:26 +00:00
The temporary directory contains artifacts for the pytest module. That module may contain multiple individual tests which were executed sequentially. The artifacts should be kept if even one of these tests failed. Since pytest doesn't have any facility to expose test results to fixtures, customize the pytest_runtest_makereport() hook to enable that. It stores the test results into a session scope variable which is available in all fixtures. When deciding whether to remove the temporary directory, find the relevant test results for this module and don't remove the tmpdir if any one the tests failed.