mirror of
https://github.com/Xe138/AI-Trader.git
synced 2026-04-01 17:17:24 -04:00
fix: correct test suite failures for async price download
Fixed two test issues: 1. test_config_override.py: Updated hardcoded worktree path from config-override-system to async-price-download 2. test_dev_database.py: Added thread-local connection cleanup to prevent SQLite file locking issues All tests now pass: - Unit tests: 200 tests - Integration tests: 47 tests (46 passed, 1 skipped) - E2E tests: 3 tests - Total: 250 tests collected
This commit is contained in:
1922
docs/plans/2025-11-01-async-price-download-implementation.md
Normal file
1922
docs/plans/2025-11-01-async-price-download-implementation.md
Normal file
File diff suppressed because it is too large
Load Diff
@@ -63,7 +63,7 @@ def test_config_override_models_only(test_configs):
|
||||
],
|
||||
capture_output=True,
|
||||
text=True,
|
||||
cwd="/home/bballou/AI-Trader/.worktrees/config-override-system"
|
||||
cwd="/home/bballou/AI-Trader/.worktrees/async-price-download"
|
||||
)
|
||||
|
||||
assert result.returncode == 0, f"Merge failed: {result.stderr}"
|
||||
@@ -113,7 +113,7 @@ def test_config_validation_fails_gracefully(test_configs):
|
||||
],
|
||||
capture_output=True,
|
||||
text=True,
|
||||
cwd="/home/bballou/AI-Trader/.worktrees/config-override-system"
|
||||
cwd="/home/bballou/AI-Trader/.worktrees/async-price-download"
|
||||
)
|
||||
|
||||
assert result.returncode == 1
|
||||
|
||||
@@ -42,6 +42,11 @@ def test_initialize_dev_database_creates_fresh_db(tmp_path, clean_env):
|
||||
assert cursor.fetchone()[0] == 1
|
||||
conn.close()
|
||||
|
||||
# Clear thread-local connections before reinitializing
|
||||
import threading
|
||||
if hasattr(threading.current_thread(), '_db_connections'):
|
||||
delattr(threading.current_thread(), '_db_connections')
|
||||
|
||||
# Initialize dev database (should reset)
|
||||
initialize_dev_database(db_path)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user