Skip to content

Test Model Target errors through vws-python-mock - #3171

Merged
adamtheturtle merged 1 commit into
mainfrom
codex/issue-3169
Aug 26, 2026
Merged

Test Model Target errors through vws-python-mock#3171
adamtheturtle merged 1 commit into
mainfrom
codex/issue-3169

Conversation

@adamtheturtle

@adamtheturtle adamtheturtle commented Aug 26, 2026

Copy link
Copy Markdown
Member

Closes #3169.

Updates the development dependency to vws-python-mock 2026.8.26.1 and exercises synchronous and asynchronous Model Target failures through the normal public HTTP paths. The tests cover authentication, JSON and non-JSON 4xx responses, rate limiting, and server errors while preserving response status and body.

This removes the reachable # pragma: no cover exclusions from the 429 and 5xx response mappings. It also updates existing Model Target tests to the current released mock contract for dataset archives, shared route visibility, and required view fields.

Validation:

  • uv run --extra=dev coverage run -m pytest -q (413 passed)
  • uv run --extra=dev coverage report (100% statements and branches)
  • uv run --extra=dev prek run --all-files
  • uv run --extra=dev prek run --all-files --hook-stage manual

Note

Low Risk
Test and dev-dependency updates plus coverage pragma removal; production error-handling logic is unchanged aside from making existing branches fully covered.

Overview
Bumps the dev dependency vws-python-mock to 2026.8.26.1 and adds parameterized sync/async tests that drive dataset create failures through MockVWS(model_target_failure_response=...), asserting the right exceptions and preserved status/body for auth, generic 4xx (JSON and non-JSON), 429, and 5xx.

Removes # pragma: no cover on the rate-limit and server-error branches in raise_for_error so those paths are counted in coverage. Replaces the custom invalid-bearer transport test with the mock-based error suite.

Aligns existing lifecycle tests with the updated mock: downloaded archives are MTDataset.dat / MTDataset.xml, standard and advanced routes share datasets by UUID, and some models pass explicit views=[].

Reviewed by Cursor Bugbot for commit 70aab3e. Bugbot is set up for automated code reviews on this repo. Configure here.

@adamtheturtle
adamtheturtle merged commit 294e5ae into main Aug 26, 2026
14 checks passed
@adamtheturtle
adamtheturtle deleted the codex/issue-3169 branch August 26, 2026 10:40
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.

Test Model Target error responses through vws-python-mock

1 participant