Skip to content

fix: Use existing OHLCV data files and make Windows path compatible in tests/domain (#371)#372

Merged
MDUYN merged 1 commit intodevfrom
fix/371-ohlcv-data-windows-paths
Mar 11, 2026
Merged

fix: Use existing OHLCV data files and make Windows path compatible in tests/domain (#371)#372
MDUYN merged 1 commit intodevfrom
fix/371-ohlcv-data-windows-paths

Conversation

@MDUYN
Copy link
Copy Markdown
Collaborator

@MDUYN MDUYN commented Mar 11, 2026

Summary

Fixes #371 for tests/domain/ and tests/cli/ directories.

Changes

tests/domain/models/backtesting/test_backtest.py

  • Replaced hardcoded forward-slash path to a non-existent CSV with os.path.join() pointing to existing test_data/ohlcv/ file
  • Fixes 5 test failures (FileNotFoundError)

tests/domain/utils/test_polars.py

  • Updated datetime64[ns] assertion to datetime64[us] for newer pandas compatibility (pandas now uses microsecond resolution by default)
  • Fixes 1 test failure

tests/domain/backtests/test_backtest_save.py

  • Fixed test_save_without_metrics to assert metrics.json is NOT created when no pre-computed metrics are provided — this matches the actual BacktestRun.save() behavior which only writes metrics.json when self.backtest_metrics is set
  • Fixes 1 test failure

tests/cli/ — All 7 tests already passing (no changes needed)

Test Results

  • tests/domain/: 103 passed (was 96 passed, 7 failed)
  • tests/cli/: 7 passed (no changes)
  • flake8: clean

…in tests/domain (#371)

- test_backtest.py: Replace hardcoded forward-slash path to non-existent
  backtest_data/ CSV with os.path.join to existing test_data/ohlcv/ file
- test_polars.py: Update datetime64[ns] assertion to datetime64[us] for
  newer pandas compatibility
- test_backtest_save.py: Fix test_save_without_metrics to assert metrics.json
  is NOT created when no pre-computed metrics are provided (matching actual
  BacktestRun.save() behavior)
@MDUYN MDUYN merged commit 1a7c523 into dev Mar 11, 2026
3 of 7 checks passed
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