Skip to content

fix/test: increase LLM test coverage and fix validation bugs#51

Merged
SeanClay10 merged 9 commits intomainfrom
fix/test-coverage-and-pydantic-constraints
Apr 9, 2026
Merged

fix/test: increase LLM test coverage and fix validation bugs#51
SeanClay10 merged 9 commits intomainfrom
fix/test-coverage-and-pydantic-constraints

Conversation

@SeanClay10
Copy link
Copy Markdown
Collaborator

@SeanClay10 SeanClay10 commented Apr 9, 2026

Summary

  • Fixed a Pydantic v2 bug where Optional[Annotated[str, constr(...)]] silently ignored string constraints (pattern, min_length, max_length) on species_name, study_location, and study_date in PredatorDietMetrics — moved constraints into Field() where they are actually enforced
  • Added tests/test_models.py (38 tests) covering field construction, sample_size auto-reconciliation, fraction_feeding computation, field-level validation, and JSON round-trip serialization
  • Added tests/test_llm_text.py (47 tests) covering page splitting, section priority scoring, paragraph keyword scoring, sentence truncation, budget-bounded section extraction, and document loading
  • Consolidated duplicate tests in test_pdf_classifier.py, test_pdf_extraction.py, and test_train_model.py
  • Fixed test_save_to_file_permission_error which always failed on Windows due to a hardcoded /dev/null path

@SeanClay10 SeanClay10 merged commit 42fff37 into main Apr 9, 2026
2 checks passed
@SeanClay10 SeanClay10 deleted the fix/test-coverage-and-pydantic-constraints branch April 9, 2026 19:32
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.

2 participants