test: make storage-path assertions symlink-safe on macOS#26
Open
pandashark wants to merge 1 commit into
Open
Conversation
Several path-comparison assertions compared production's resolved storage paths against unresolved expected values, so they failed on macOS where /tmp and /var are symlinks to /private/*. Resolve the expected side so the assertions match on macOS while remaining no-ops on Linux CI.
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
Several path-comparison assertions fail on macOS dev machines while passing on Linux CI. The production storage-path handling calls
.resolve()(canonicalizing symlinks), so on macOS it returns/private/tmp/...//private/var/...while the tests compare against the unresolved input (/tmp/...,Path(tmpdir), thetemp_storagefixture). On macOS/tmpand/varare symlinks to/private/*, so the assertions mismatch.Example (
tests/test_fama_french_provider.py):These pass on
ubuntu-latest(no/tmpsymlink), so CI is green, butuv run pytestfails with 8 failures on macOS.Fix
Resolve the expected side of each assertion so it matches production's canonical path. This is a no-op on Linux and correct on macOS — no production code changes.
Assertions updated (9 across 6 files):
tests/futures/test_downloader.pytests/test_cot.py(×2)tests/test_crypto_downloader.pytests/test_etf_downloader.pytests/test_macro_downloader.pytests/test_fama_french_provider.py(×3)Verification
ruff check+ruff format --checkclean.