From 85ffd1fd0ed52a59a3a6b32884ec4216edd6edce Mon Sep 17 00:00:00 2001 From: abrichr Date: Mon, 31 Aug 2026 11:27:44 -0400 Subject: [PATCH] test: make capture assertions portable --- tests/test_authentication_handoff.py | 6 ++++-- tests/test_window_capture.py | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/test_authentication_handoff.py b/tests/test_authentication_handoff.py index f7b3e05..6fd0f57 100644 --- a/tests/test_authentication_handoff.py +++ b/tests/test_authentication_handoff.py @@ -6,6 +6,7 @@ import itertools import json import multiprocessing +import os import queue import threading import time @@ -53,12 +54,13 @@ def _bound_controller(tmp_path): return controller -def test_empty_manifest_is_created_with_owner_only_permissions(tmp_path) -> None: +def test_empty_manifest_is_created_canonically(tmp_path) -> None: _bound_controller(tmp_path) marker = tmp_path / AUTHENTICATION_HANDOFF_FILENAME assert load_authentication_handoffs(tmp_path).intervals == () - assert marker.stat().st_mode & 0o077 == 0 + if os.name != "nt": + assert marker.stat().st_mode & 0o077 == 0 def test_begin_drains_inflight_retention_before_marker_starts(tmp_path) -> None: diff --git a/tests/test_window_capture.py b/tests/test_window_capture.py index dd8822f..738c9f4 100644 --- a/tests/test_window_capture.py +++ b/tests/test_window_capture.py @@ -1912,7 +1912,8 @@ def set_timeout(_element, timeout): on_screen=False, process_start_time=123.0, ) - deadline = time.monotonic() + 0.05 + monkeypatch.setattr(window_capture_module.time, "monotonic", lambda: 100.0) + deadline = 100.05 assert window_capture_module._macos_window_minimized( window,