From e81ac4b19228afee36f2d7373ecd998c459d5b5b Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Mon, 15 Jun 2026 06:31:06 -0700 Subject: [PATCH] test(computer_use): isolate backend env in check_fn test --- tests/tools/test_computer_use.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/tools/test_computer_use.py b/tests/tools/test_computer_use.py index 26e2900e0ef6..c64d9d30833d 100644 --- a/tests/tools/test_computer_use.py +++ b/tests/tools/test_computer_use.py @@ -115,11 +115,12 @@ class TestRegistration: import tools.computer_use_tool # noqa: F401 from tools.registry import registry entry = registry._tools["computer_use"] - if sys.platform == "win32": - from tools.computer_use.windows_backend import windows_backend_available - assert entry.check_fn() is windows_backend_available() - elif sys.platform != "darwin": - assert entry.check_fn() is False + with patch.dict(os.environ, {}, clear=True): + if sys.platform == "win32": + from tools.computer_use.windows_backend import windows_backend_available + assert entry.check_fn() is windows_backend_available() + elif sys.platform != "darwin": + assert entry.check_fn() is False # ---------------------------------------------------------------------------