Skip to content

test: make storage-path assertions symlink-safe on macOS#26

Open
pandashark wants to merge 1 commit into
ml4t:mainfrom
pandashark:fix/macos-path-test-symlinks
Open

test: make storage-path assertions symlink-safe on macOS#26
pandashark wants to merge 1 commit into
ml4t:mainfrom
pandashark:fix/macos-path-test-symlinks

Conversation

@pandashark

Copy link
Copy Markdown

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), the temp_storage fixture). On macOS /tmp and /var are symlinks to /private/*, so the assertions mismatch.

Example (tests/test_fama_french_provider.py):

assert PosixPath('/private/var/folders/.../ff3_monthly.parquet')
    == PosixPath('/var/folders/.../ff3_monthly.parquet')

These pass on ubuntu-latest (no /tmp symlink), so CI is green, but uv run pytest fails 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.py
  • tests/test_cot.py (×2)
  • tests/test_crypto_downloader.py
  • tests/test_etf_downloader.py
  • tests/test_macro_downloader.py
  • tests/test_fama_french_provider.py (×3)

Verification

  • The 8 formerly-failing tests now pass on macOS.
  • Full suite: 2,850 passed, 0 failed (was 2,842 passed / 8 failed on macOS).
  • ruff check + ruff format --check clean.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant