test: add direct unit coverage for domain-expert heuristic analyzers - #1183
Draft
madara88645 wants to merge 1 commit into
Draft
test: add direct unit coverage for domain-expert heuristic analyzers#1183madara88645 wants to merge 1 commit into
madara88645 wants to merge 1 commit into
Conversation
_analyze_business, _analyze_education, _analyze_data_science, _analyze_creative_writing, _detect_story_structure, and the analyze_domain router in app/heuristics/handlers/domain_expert.py were previously only exercised indirectly through full-pipeline compile_text() calls, which never asserted on their specific branch/edge-case behavior. This adds direct coverage for each, plus a few detect_implied_persona cases (multi-match confidence scaling, no-match fallback, position tie-break) not covered by the existing tests/test_regex_precompilation.py. Co-Authored-By: Claude <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
app/heuristics/handlers/domain_expert.py:_analyze_business,_analyze_education,_analyze_data_science,_analyze_creative_writing,_detect_story_structure, and the publicanalyze_domainrouter.compile_text()integration tests, which never asserted on their specific branch/edge-case behavior (e.g. which suggestions/diagnostics fire for which inputs).detect_implied_personacases (multi-match confidence scaling, no-match fallback, position-based tie-break) that aren't covered by the existingtests/test_regex_precompilation.py, without duplicating the cases that file already covers.Test plan
python -m pytest tests/heuristics/test_domain_expert_analyzers.py -v— 25 passedpython -m pytest tests/ -q(full suite) — 2380 passed, 7 skipped, unchanged from baselineGenerated by Claude Code