mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-22 00:31:44 +00:00
fix(compat): skip writing compat-results.json when no compat tests ran
The pytest_sessionfinish hook in tests/claude_code/conftest.py is loaded for every pytest run under tests/claude_code/, including sibling unit- test trees (_driver_unit_tests/, _builder_unit_tests/, ...). Without a guard, those runs wrote an empty results artifact and silently overwrote any real artifact from a prior compat-test run.
This commit is contained in:
parent
597d99b026
commit
2073f85eaf
1 changed files with 10 additions and 1 deletions
|
|
@ -158,7 +158,16 @@ def pytest_sessionstart(session):
|
|||
|
||||
|
||||
def pytest_sessionfinish(session, exitstatus):
|
||||
"""Write the structured results artifact at end of session."""
|
||||
"""Write the structured results artifact at end of session.
|
||||
|
||||
Skip writing when no compat results were collected — this conftest is
|
||||
loaded by pytest for every test under `tests/claude_code/`, including
|
||||
sibling unit-test trees (e.g. `_driver_unit_tests/`). Writing an empty
|
||||
artifact in those runs would silently overwrite a real artifact from a
|
||||
prior compat-test run on the same checkout.
|
||||
"""
|
||||
if not _COLLECTOR.items:
|
||||
return
|
||||
artifact_path = os.environ.get(RESULTS_ARTIFACT_ENV) or DEFAULT_ARTIFACT_PATH
|
||||
payload = {
|
||||
"schema_version": "1",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue