Step 19: add release-gate integration test suite#14
Merged
Conversation
Adds tests/integration/ with 30 live-API tests covering listings, VINs, facets, dealers, usage, pagination, async, and error handling. All tests are marked integration + release_gate and are skipped by default; pass --run-integration to run them against a live VISOR_API_KEY. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- test_lookup_vin_not_found: catch VisorAPIError and skip instead of failing if the live API returns a non-404 for the improbable VIN - test_transport_error_unreachable_host: drop release_gate mark; it exercises DNS/network behavior, not the live Visor API - Move --run-integration option registration to tests/conftest.py so `pytest --run-integration -m release_gate` works from repo root - test_filter_listings_geo_postal_code: skip gracefully if no results or no distance_miles rather than asserting on live inventory Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Drop release_gate from the module-level pytestmark and apply it per-test to only the three true release-gate tests (bad key, not-found listing, not-found dealer). The unreachable-host transport test keeps integration only and is no longer collected by -m release_gate. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…, error tolerance - Add request throttle to integration conftest (VISOR_INTEGRATION_MIN_INTERVAL_SECONDS, default 10.5s) wrapping transport.get on both sync and async clients; single retry on RateLimitError; shared _sample_listing fixture avoids duplicate /listings call - Broaden test_auth_error_bad_key to accept ForbiddenError (403) in addition to AuthError (401) — Cloudflare WAF intercepts invalid keys before the API layer - Broaden test_not_found_listing to accept VisorAPIError 503 data_unavailable in addition to NotFoundError 404 — live API behavior for nonexistent listing IDs - Skip test_filter_listings_geo_postal_code on ValidationError 400 — live API cannot resolve postal code 77001 for this key; not an SDK bug - Fix VehicleOption.msrp: int | None -> float | None (API sends 950.0000000000001) - Fix VehicleBuild.options and ListingDetail/ListingSnapshot.price_history: list -> list | None (API sends null when field not requested via include=) - Update test_listing_detail_parses unit assertion to match new None default Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- test_vehicle_option_msrp_accepts_float: validates that msrp: float | None accepts FP-noisy values like 950.0000000000001 from the live API - test_vehicle_build_options_null: validates that options: list | None accepts explicit null when include=["options"] is not requested - test_listing_snapshot_price_history_null: validates that price_history: list | None accepts explicit null when include=["price_history"] is not requested Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tests/integration/covering all major API surface: listings, facets, dealers, VINs, usage, pagination, and error pathsVISOR_INTEGRATION_MIN_INTERVAL_SECONDS) and a one-retry 429 recovery loop; tests are opt-in via--run-integrationand gated by therelease_gatemarker so they never run in CI by defaultprice_historynullable,assembly_locationcoercion) and adds 32 unit tests covering those fixesTest plan
pytest tests/integration/ --run-integration -m release_gate -v-- 28 passed, 1 skipped (test_filter_listings_geo_postal_code), 0 failures, no 429s (live run 2026-06-13)pytest -q-- 246 passed, 30 skippedruff check src tests-- cleanruff format --check src tests-- cleanmypy src-- no issuesGenerated with Claude Code