Files
arbitrade/tests/unit/test_detection_benchmark.py

20 lines
628 B
Python

import pytest
from arbitrade.detection.benchmark import run_incremental_detection_benchmark
def test_incremental_detection_benchmark_returns_metrics() -> None:
result = run_incremental_detection_benchmark(iterations=500)
assert result.iterations == 500
assert result.total_ms > 0.0
assert result.avg_ms > 0.0
assert result.p50_ms > 0.0
assert result.p95_ms > 0.0
assert result.max_ms >= result.p95_ms
def test_incremental_detection_benchmark_rejects_invalid_iterations() -> None:
with pytest.raises(ValueError, match="iterations"):
run_incremental_detection_benchmark(iterations=0)