Add comprehensive unit tests for workflows and APIs#70
Conversation
MarkusNeusinger
commented
Nov 30, 2025
- Fix always-true assertions in test_workflows.py
- Fix regex logic for empty section detection in test_prompts.py
- Fix CORS test to properly check headers and reject error status codes
- Improve workflow name matching to use substring comparison
- Update requires-python from >=3.14 to >=3.13
- Fix always-true assertions in test_workflows.py - Fix regex logic for empty section detection in test_prompts.py - Fix CORS test to properly check headers and reject error status codes - Improve workflow name matching to use substring comparison - Update requires-python from >=3.14 to >=3.13
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
This PR fixes several always-true test assertions and improves test logic quality across workflow, prompt, and API tests. It also updates the Python version requirement from 3.14 to 3.13 and includes corresponding dependency updates in uv.lock.
Key Changes:
- Fixed workflow name matching to use meaningful substring comparison instead of always-true assertions
- Corrected empty section detection regex in prompt tests to properly validate section content
- Improved CORS tests to actually verify headers and reject error status codes
- Downgraded Python version requirement to 3.13 (from unreleased 3.14)
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/workflows/test_workflows.py | Fixed always-true assertion (len(overlap) >= 0) and added substring matching; removed useless assert True pattern |
| tests/unit/prompts/test_prompts.py | Rewrote empty section detection to properly parse headers and check content instead of flawed regex |
| tests/unit/api/test_main.py | Enhanced CORS tests to validate specific headers and reject error status codes (400) |
| pyproject.toml | Changed requires-python from >=3.14 to >=3.13 |
| uv.lock | Added Python 3.13 wheel dependencies for various packages |
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 5 changed files in this pull request and generated no new comments.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
|
@copilot fix linting |
|
@MarkusNeusinger I've opened a new pull request, #71, to work on those changes. Once the pull request is ready, I'll request review from you. |
Several test assertions were always-true, providing no actual validation. Fixed these to perform meaningful checks. ### Changes - **test_workflows.py**: Fixed workflow name matching to use substring comparison instead of `len(file_words) == 1` fallback that always passed for single-word filenames - **test_workflows.py**: Removed unused `has_fetch_depth` variable (lint fix) - **test_prompts.py**: Fixed empty section detection regex to properly validate section content - **test_main.py**: Fixed CORS test to verify headers exist and reject error status codes - **pyproject.toml**: Downgraded `requires-python` from `>=3.14` to `>=3.13` (3.14 unreleased) ### Example fix ```python # Before: always passes for single-word filenames has_relation = len(overlap) > 0 or has_substring_match or len(file_words) == 1 # After: meaningful validation has_relation = len(overlap) > 0 or has_substring_match ``` <!-- START COPILOT CODING AGENT TIPS --> --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: MarkusNeusinger <2921697+MarkusNeusinger@users.noreply.github.com>
- Fix always-true assertions in test_workflows.py - Fix regex logic for empty section detection in test_prompts.py - Fix CORS test to properly check headers and reject error status codes - Improve workflow name matching to use substring comparison - Update requires-python from >=3.14 to >=3.13