diff --git a/requirements/test.txt b/requirements/test.txt index 4b4fbc0b..da7f56e9 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -1,3 +1,4 @@ # Requirements for test. coverage +hypothesis pytest diff --git a/test/backtesting/test_vbt_backtest_deep.py b/test/backtesting/test_vbt_backtest_deep.py index 7c4bb562..661e6620 100644 --- a/test/backtesting/test_vbt_backtest_deep.py +++ b/test/backtesting/test_vbt_backtest_deep.py @@ -1,3 +1,4 @@ + """Deep property-based tests for the unified backtest engine. Extends test_vbt_backtest.py with hypothesis-based property tests, @@ -10,8 +11,8 @@ import numpy as np import pandas as pd import pytest -from hypothesis import assume, given, settings from hypothesis import strategies as st +from hypothesis import assume, given, settings from hypothesis.extra.numpy import arrays from rdagent.components.backtesting.vbt_backtest import ( diff --git a/test/local/test_autopilot.py b/test/local/test_autopilot.py index 338933b2..a53afbb1 100644 --- a/test/local/test_autopilot.py +++ b/test/local/test_autopilot.py @@ -5,6 +5,8 @@ the StrategyOrchestrator at the correct import path. """ from __future__ import annotations +from hypothesis import given, settings, HealthCheck +from hypothesis import strategies as st import sys from pathlib import Path diff --git a/test/local/test_continuous_strategies.py b/test/local/test_continuous_strategies.py index 4a912fa6..04103b00 100644 --- a/test/local/test_continuous_strategies.py +++ b/test/local/test_continuous_strategies.py @@ -5,6 +5,8 @@ without requiring real StrategyOrchestrator connections. """ from __future__ import annotations +from hypothesis import given, settings, HealthCheck +from hypothesis import strategies as st import sys from pathlib import Path diff --git a/test/local/test_gen_strategies.py b/test/local/test_gen_strategies.py index cb530677..5ac0c699 100644 --- a/test/local/test_gen_strategies.py +++ b/test/local/test_gen_strategies.py @@ -5,6 +5,8 @@ criteria, and the TeeFile logger — without requiring real OHLCV data or LLM. """ from __future__ import annotations +from hypothesis import given, settings, HealthCheck +from hypothesis import strategies as st import json import os diff --git a/test/local/test_nexquant_parallel.py b/test/local/test_nexquant_parallel.py index a7c8aee3..f625b018 100644 --- a/test/local/test_nexquant_parallel.py +++ b/test/local/test_nexquant_parallel.py @@ -5,6 +5,8 @@ command building, and API key loading logic. """ from __future__ import annotations +from hypothesis import given, settings, HealthCheck +from hypothesis import strategies as st import os import signal diff --git a/test/qlib/test_verify_runtime_deep.py b/test/qlib/test_verify_runtime_deep.py index 0a3dfb8a..610d45dc 100644 --- a/test/qlib/test_verify_runtime_deep.py +++ b/test/qlib/test_verify_runtime_deep.py @@ -1,3 +1,4 @@ + """Deep tests for verify_runtime — property-based, fuzzing, edge cases. Extends test_verify_runtime.py with property-based tests using hypothesis @@ -15,8 +16,8 @@ import pytest PROJECT_ROOT = Path(__file__).parent.parent.parent sys.path.insert(0, str(PROJECT_ROOT)) -from hypothesis import assume, given, settings from hypothesis import strategies as st +from hypothesis import given, settings from hypothesis.extra.numpy import arrays from rdagent.components.backtesting.verify import verify_and_log, verify_backtest_result