test(strategy_crypto): smoke regression + import-mode importlib per workspace

NEW src/strategy_crypto/tests/test_imports.py:
- test_backend_imports — verifica re-export PaperExecutor/Portfolio/PaperRepository + schema
- test_frontend_imports — strategy_crypto.frontend.{data,nicegui_app} importabili
- test_strategies_json_loadable — i JSON sono in importlib.resources e ben formati
- test_init_schema_creates_tables — PaperRepository.init_schema() crea 5 tabelle

Fix pytest collection: add --import-mode=importlib agli addopts per evitare
collisione dei due tests/__init__.py (core + strategy_crypto) sotto stesso
nome module 'tests'.

Verifica: uv run pytest → 186 passed (182 core + 4 strategy_crypto)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Adriano Dal Pastro
2026-05-15 18:01:30 +00:00
parent 289df4b81f
commit 8caa526727
2 changed files with 68 additions and 1 deletions
+1 -1
View File
@@ -38,7 +38,7 @@ strict = true
[tool.pytest.ini_options]
testpaths = ["src/multi_swarm_core/tests", "src/strategy_crypto/tests"]
addopts = "-v --tb=short"
addopts = "-v --tb=short --import-mode=importlib"
markers = [
"integration: tests that require external services (Cerbero, LLM API)",
"slow: tests that take more than 5 seconds",