Repository navigation
Conversation
test_sdoh and nlp/test_metrics read test-resources/... relative to the current directory, so they failed whenever the suite was run from anywhere but the repo root (for example the documented 'cd tests && python -m unittest core.x'). Resolve the paths from __file__, as the other tests already do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Problem
Two tests read their data file relative to the current directory:
tests/core/test_sdoh.py:pd.read_csv('test-resources/core/sdoh-test-cases.csv')tests/nlp/test_metrics.py:Path('test-resources/nlp/metrics.csv')They pass in CI, which runs from the repo root, but fail with
FileNotFoundErrorwhen the suite is run from anywhere else. That includes running one module fromtests/(cd tests && python -m unittest core.test_sdoh). In the full core suite run that way,test_sdohwas the only error, which made real failures easier to miss.Fix
Resolve both paths from
__file__(Path(__file__).parents[2] / "test-resources" / ...), as the other tests already do. These were the only two cwd-relative resource paths undertests/.Tests
Both modules pass when run from the repo root, from
tests/and from an unrelated directory (/tmp). Before, the run fromtests/failed. Test-only change;tools/check_pr_rules.pypasses.🤖 Generated with Claude Code