fix: make PYTHONPATH test assertion repo-name agnostic#44
Conversation
The test was asserting that PYTHONPATH contains "archaeology" or "DEV-ARCH" — hardcoded local directory names. In CI the repo is cloned as "devarch-framework", so neither substring matched. Replace with an assertion that PYTHONPATH is an absolute path (which is the actual invariant the CLI code guarantees via Path(__file__).parent.parent). Fixes #39
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR updates the CLI coverage test to assert that the first segment of the PYTHONPATH environment variable (split on the platform path separator) is an absolute filesystem path, replacing repository-specific substring checks. ChangesCLI Coverage Test Robustness
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/test_cli_coverage.py`:
- Around line 404-406: The current assertion splits PYTHONPATH token pp on ":"
first which breaks Windows drive letters; update the assertion to split on the
platform path separator (use os.pathsep) instead of ":" so you check the first
path component correctly (replace pp.split(":")[0].split(";")[0] with
pp.split(os.pathsep)[0] when calling os.path.isabs). Ensure the change
references the pp variable and the assertion in tests/test_cli_coverage.py.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 248deb3c-ea65-4d8b-ae20-eb86f468e8a6
📒 Files selected for processing (1)
tests/test_cli_coverage.py
Problem
test_build_db_propagates_pythonpathfails on CI because it asserts PYTHONPATH contains"archaeology"or"DEV-ARCH"— hardcoded local directory names. The CI runner clones intodevarch-framework/, so neither substring matches.Fix
Replace the hardcoded directory-name assertion with a check that PYTHONPATH is an absolute path — which is the actual invariant the CLI code guarantees (it sets
_pkg_root = Path(__file__).parent.parent).Evidence
Need help on this PR? Tag
@codesmithwith what you need. Autofix is disabled.Summary by CodeRabbit