Conversation
Replace the single test_.py with three focused modules: - test_grammar.py: build_grammar and make_guided_extra_body (22 tests) - test_json_schema.py: build_json_schema covering all branches (9 tests) - test_agent.py: CRAgent.set_guide, vllm_model_profile, and original end-to-end output type tests (27 tests) Increases total coverage from ~4 tests to 58 tests, with 98% overall coverage and 100% branch coverage of cragents/__init__.py. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
pytest-xdist writes per-worker coverage files that must be merged with `coverage combine` before `coverage report` can read them. Without this, CI collected no coverage data. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Runs pre-commit install so that hooks in .pre-commit-config.yaml are triggered automatically on every git commit. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove the format hook from pre-commit so both local and CI environments run ruff in check-only mode (make lint). Auto-fixing was silently masking lint errors before commit. Also fix the unsorted import in test_grammar.py that exposed the gap. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add a matrix to the test job that runs twice in parallel: - min: installs exactly pydantic-ai==1.25.1 (the declared minimum) - latest: upgrades pydantic-ai to the newest published version Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
--override is not a valid uv flag. --resolution lowest-direct is the correct uv mechanism: it resolves direct dependencies to their lowest allowed version as declared in pyproject.toml, so the min version is always read from source rather than hardcoded in the workflow. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
pre-commit was only a transitive dep through the example group so add it explicitly to the dev group. Also drop --all-extras from CI uv sync calls since the project has no optional-dependencies defined. Co-Authored-By: Claude Opus 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
Replaces the original 4-test
test_.pywith three focused modules:test_grammar.py—build_grammarandmake_guided_extra_body: all element types, edge cases (regex escaping, UID ordering, custom tokens,tool_namesvs regex)test_json_schema.py—build_json_schema: all branches includingObjectOutputProcessor,DeferredToolRequests,BinaryImage, deduplication, and$defsmerging from shared sub-modelstest_agent.py—CRAgent.set_guide: error handling, model settings preservation, idempotent re-configuration, toolset schema merging, and the original end-to-end output type snapshot testscragents/__init__.pycragents/_types.pycragents/_utils.pycragents/_version.pyCI fixes
make testis now used in the workflow so Makefile and CI can't drift apartcoverage combineandcoverage reportsteps were missing — coverage data was being collected by parallel workers but never merged or reported--resolution lowest-direct) and pydantic-ai latest (--upgrade-package) in parallel--all-extrasfromuv synccalls since the project has no optional dependenciesPre-commit / local dev
formathook from.pre-commit-config.yaml— it was auto-fixing issues beforelintran, silently masking errors that CI would catchmake installtarget to set up git hooks (uv run pre-commit install)Dependencies
exampledependency group (moved to separate repo), reducing the lockfile by ~1,450 linespre-commitexplicitly to the dev group (was previously only a transitive dep through the example group)Test plan
make lintandmake typecheckclean🤖 Generated with Claude Code