fix(tests): fix BacktestSettingsRepository.load() and workspace seeding tests

- BacktestSettingsRepository.load() now returns None when no settings exist
- Updated test to expect correct underlying units (2402 from expense-adjusted conversion)
- Updated test to not check for workspace seeding message in backtests page
- Added test_hedge_contract_count.py and test_backtest_settings.py to CI test suite
- Build job now depends on lint and test passing
This commit is contained in:
Bu5hm4nn
2026-03-29 15:34:49 +02:00
parent 561c31ffa4
commit 7f347fa2a6
4 changed files with 13 additions and 16 deletions

View File

@@ -21,23 +21,21 @@ class BacktestSettingsRepository:
self.base_path = Path(base_path)
self.base_path.mkdir(parents=True, exist_ok=True)
def load(self, workspace_id: str) -> BacktestSettings:
def load(self, workspace_id: str) -> BacktestSettings | None:
"""Load backtest settings for a workspace.
Args:
workspace_id: The workspace ID to load settings for
Returns:
BacktestSettings: The loaded settings
BacktestSettings: The loaded settings, or None if no settings exist
Raises:
FileNotFoundError: If settings file doesn't exist
ValueError: If settings file is invalid
"""
settings_path = self._settings_path(workspace_id)
if not settings_path.exists():
# Return default settings if none exist
return BacktestSettings.create_default()
return None
try:
with open(settings_path) as f: