A test that fails (incl. all the failing retries before a passing one) can otherwise overwrite a known-good cassette with a 'bad luck' recording. Tests like test_prompt_caching, which assert on provider state across two calls, can produce a 200 response that semantically fails the assertion — the 2xx filter doesn't catch this because the HTTP layer is fine. - pytest_runtest_makereport hook attaches each phase report to the pytest item. - _vcr_outcome_gate fixture (combining the verbose-mode reporter) reads the call-phase outcome at teardown and informs the persister via mark_test_outcome_for_cassette before vcrpy's Cassette.__exit__ triggers save_cassette. - save_cassette consults the per-key 'did the test pass?' flag and short-circuits when False, leaving any prior good recording intact. - Defaults to passed=True when no marker is present so non-test usage of the persister still works. |
||
|---|---|---|
| .. | ||
| base_responses_api.py | ||
| conftest.py | ||
| test_anthropic_responses_api.py | ||
| test_anthropic_tool_result_empty_call_id.py | ||
| test_anthropic_tool_result_fix.py | ||
| test_azure_responses_api.py | ||
| test_base_responses_api_streaming_iterator.py | ||
| test_google_ai_studio_responses_api.py | ||
| test_openai_responses_api.py | ||
| test_responses_hooks.py | ||