Spaces:
Running
Running
Download e2e/artifacts.py from dherain24/claude-proxy: direct link, hf CLI and curl.
- Browser
- Download file 1.08 kB
-
https://huggingface.co/spaces/dherain24/claude-proxy/resolve/main/e2e/artifacts.py
- Command line
-
hf download hf://spaces/dherain24/claude-proxy/e2e/artifacts.py
-
curl -L -o artifacts.py https://huggingface.co/spaces/dherain24/claude-proxy/resolve/main/e2e/artifacts.py
1.08 kB
| """Keep failure evidence without serializing artifacts already due for deletion.""" | |
| import pytest | |
| def discard_passed_artifacts(recorder, request): | |
| record_context = recorder.on_will_close_browser_context | |
| def close_context(context): | |
| report = getattr(request.node, "rep_call", None) | |
| if ( | |
| report is not None | |
| and report.passed | |
| and request.config.getoption("--tracing") != "on" | |
| and request.config.getoption("--screenshot") != "on" | |
| ): | |
| # Stop recording without building a ZIP or PNG that the plugin | |
| # would immediately delete. Its normal video cleanup still runs. | |
| context.tracing.stop() | |
| else: | |
| # A context closed during setup or the test may precede a failure. | |
| record_context(context) | |
| recorder.on_will_close_browser_context = close_context | |
| return recorder | |
| def failure_artifacts_recorder(_artifacts_recorder, request): | |
| return discard_passed_artifacts(_artifacts_recorder, request) | |