mirror of
https://ghfast.top/https://github.com/aeroxw/easy-tdx.git
synced 2026-09-12 16:54:17 +08:00
chore(tests): 修复 ruff UP038 (isinstance 元组 -> int | float)
test_web_backtest.py:556 的 isinstance(x, (int, float)) 触发 ruff UP038。 requires-python>=3.10 支持 PEP 604 的 int | float 运行时语法, 转换安全。 该报错会导致 GitHub Actions CI 失败。
This commit is contained in:
@@ -553,7 +553,7 @@ def test_sync_backtest_with_inline_data(client, sample_ohlcv):
|
||||
assert "config" in body
|
||||
# 绩效指标存在且为原生类型
|
||||
assert "total_return" in body["performance"]
|
||||
assert isinstance(body["performance"]["total_return"], (int, float))
|
||||
assert isinstance(body["performance"]["total_return"], int | float)
|
||||
# 净值曲线有数据
|
||||
assert len(body["equity_curve"]) > 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user