Files
manual_slop/tests/test_performance_monitor.py
Ed_ 60396f03f8 refactor(types): auto -> None sweep across entire codebase
Applied 236 return type annotations to functions with no return values
across 100+ files (core modules, tests, scripts, simulations).
Added Phase 4 to python_style_refactor track for remaining 597 items
(untyped params, vars, and functions with return values).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 11:16:56 -05:00

28 lines
675 B
Python

import pytest
import sys
import os
import time
# Ensure project root is in path
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
from performance_monitor import PerformanceMonitor
def test_perf_monitor_basic_timing() -> None:
pm = PerformanceMonitor()
pm.start_frame()
time.sleep(0.02) # 20ms
pm.end_frame()
metrics = pm.get_metrics()
assert metrics['last_frame_time_ms'] >= 20.0
pm.stop()
def test_perf_monitor_component_timing() -> None:
pm = PerformanceMonitor()
pm.start_component("test_comp")
time.sleep(0.01)
pm.end_component("test_comp")
metrics = pm.get_metrics()
assert metrics['time_test_comp_ms'] >= 10.0
pm.stop()