study-buddy / tests /test_pair_buddy_turn_timing.py
GitHub Actions
deploy d092bea3608b7a29952f16357fda39b7a29e399b
2e818da
Raw
History Blame Contribute Delete
528 Bytes
import logging
import os
os.environ.setdefault("CEREBRAS_API_KEY", "test-key")
from app.websockets import handlers
def test_pair_buddy_turn_phase_log_has_safe_timing_fields(caplog):
with caplog.at_level(logging.INFO, logger=handlers.__name__):
handlers._log_pair_buddy_turn_phase(
"1234567890abcdef",
"context_ready",
10.0,
now=10.125,
)
assert caplog.messages == [
"[PAIR_BUDDY] turn phase=context_ready project=12345678 elapsed_ms=125"
]