Skip to content

test(builder): make pytest runnable without starlette; pin contract - #101

Open
iap wants to merge 1 commit into
mainfrom
test/pytest-starlette-contract
Open

test(builder): make pytest runnable without starlette; pin contract#101
iap wants to merge 1 commit into
mainfrom
test/pytest-starlette-contract

Conversation

@iap

@iap iap commented Sep 5, 2026

Copy link
Copy Markdown
Owner

What kind of change is this?

  • bug fix + test

Summary

  • pytest.ini's ignore::starlette.exceptions.StarletteDeprecationWarning made the whole suite unrunnable in any environment without starlette: pytest imports the warning category at config-parse time, so it died with ModuleNotFoundError before collecting a single test (verified with a plain python3). conftest.py already applies the identical filter conditionally at import time, so the ini filter was strictly redundant — removed, with a constraint comment so it is not re-added the next time the Starlette warning shows up in a venv.
  • verify.py's expected registered-tools set now includes q_debug, so the "all tools registered" gate catches its removal (the secret-scan loop already covered it).
  • tests/test_import_contract.py pins ensure_valid in SSO_OIDC_SYMBOLS, making AGENTS.md's claim that the full public auth API is pinned actually true.

Evidence: full suite 228 passed, 1 skipped; a starlette-less python3 -m pytest previously crashed at config parse and now collects all 229 tests.

Branch

This PR was opened from a branch using one of:

  • fix/…
  • bugs/…
  • feature/…

(branch prefix test/… — same convention as chore/…, sec/… on this repo)

Checklist

  • Tests pass: python -m pytest -q -k "not adapter"
  • verify.py is green
  • No raw tokens/secrets in code, logs, or tool output
  • Adapter stays loopback-only unless an explicit guard is added
  • Updated docs/README if user-facing behavior changed (no user-facing change)

Greptile Summary

This change makes pytest configuration resilient when Starlette is not installed and strengthens the checked public contracts for ensure_valid and q_debug. The focused checks completed successfully; the available environment’s broader collection is separately limited by an unrelated FastAPI/Starlette dependency mismatch.

Confidence Score: 5/5

Safe to merge: the updated collection behavior and strengthened import and registration contracts work as intended.

No defects were established in the changed code. The optional-Starlette scenario, the public import contract, and the headless tool-registration check all completed successfully.

Files Needing Attention: None.

T-Rex T-Rex Logs

What T-Rex did

  • Ran the authored harness script to drive the contract-validation workflow and collect outputs.
  • Generated before/after captures showing that removing the ini filter avoids configuration-time Starlette imports.
  • Executed the headless import contract and verify.py output to exercise ensure_valid and q_debug contracts, and confirmed they completed successfully.
  • Verified that no repository files were modified during the run and that the harness outputs were saved as artifacts.

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (1): Last reviewed commit: "test(builder): make pytest runnable with..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant