The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
docs(tests): name platforms() instead of the retired OS markers
ethernete0735f889148
diff --git a/tests/gateway/test_whatsapp_connect.py b/tests/gateway/test_whatsapp_connect.pyindex 20837b135e9..40da4d16cf8 100644--- a/tests/gateway/test_whatsapp_connect.py+++ b/tests/gateway/test_whatsapp_connect.py@@ -277,7 +277,7 @@ class TestKillPortProcess:@pytest.mark.platforms("windows")def test_uses_netstat_and_taskkill_on_windows(self):- """``windows_only``: netstat/taskkill are Windows binaries. The old+ """``platforms("windows")``: netstat/taskkill are Windows binaries. The old``_IS_WINDOWS`` patch selected this branch on Linux, where neitherexists, so the mocked argv was the only thing under test."""from plugins.platforms.whatsapp.adapter import _kill_port_process@@ -347,7 +347,7 @@ class TestKillPortProcess:processes (a browser tab on the same port). The implementation nowresolves listeners via ``_listener_pids_on_port`` and signals only those.- ``linux_only``: asserts the POSIX ``os.kill``/SIGTERM path, which is+ ``platforms("linux")``: asserts the POSIX ``os.kill``/SIGTERM path, which isgenuinely selected here without patching ``_IS_WINDOWS``."""from plugins.platforms.whatsapp import adapter as wa@@ -393,7 +393,7 @@ class TestHttpSessionLifecycle:async def test_disconnect_uses_taskkill_tree_on_windows(self):"""Windows disconnect should target the bridge process tree, not just the parent PID.- ``windows_only``: ``taskkill /T`` is the Windows tree-kill primitive;+ ``platforms("windows")``: ``taskkill /T`` is the Windows tree-kill primitive;on Linux the branch was reachable only by faking ``_IS_WINDOWS``."""adapter = _make_adapter()diff --git a/tests/hermes_cli/test_gateway_service.py b/tests/hermes_cli/test_gateway_service.pyindex c21f6d5ee77..e1daa385300 100644--- a/tests/hermes_cli/test_gateway_service.py+++ b/tests/hermes_cli/test_gateway_service.py@@ -2696,7 +2696,7 @@ class TestUnitAnchoredServiceIdentity:"""The installed ``hermes-gateway.service`` owns the bare name: under ``sudo`` the naming basis movesmid-command when ``_sync_hermes_home_from_systemd_unit()`` adopts the unit's HERMES_HOME (#108674).- ``linux_only`` because ``_bare_unit_pinned_home()`` is Linux- and root-gated on purpose: a systemd unit+ ``platforms("linux")`` because ``_bare_unit_pinned_home()`` is Linux- and root-gated on purpose: a systemd unitis not an identity authority for launchd labels, Windows tasks, or s6 slots, which share the sameresolver, and only an elevated process operates the system unit."""diff --git a/tests/hermes_cli/test_kanban_db.py b/tests/hermes_cli/test_kanban_db.pyindex 824a38429d4..c9a8b172cbb 100644--- a/tests/hermes_cli/test_kanban_db.py+++ b/tests/hermes_cli/test_kanban_db.py@@ -59,7 +59,7 @@ def test_cross_process_init_lock_uses_windows_byte_range_lock(tmp_path, monkeypawedged holder can never block connect() forever; a clean acquire takes thelock once and releases it once.- ``windows_only``: ``msvcrt`` does not exist off Windows, so faking+ ``platforms("windows")``: ``msvcrt`` does not exist off Windows, so faking``_IS_WINDOWS`` on Linux meant injecting a fake ``msvcrt`` module too —the test then asserted against its own stub rather than the byte-rangelocking API. Here the platform is real; only ``msvcrt.locking`` isdiff --git a/tests/hermes_cli/test_launchd_plist_guard.py b/tests/hermes_cli/test_launchd_plist_guard.pyindex 569ab202d35..42dd6c399e0 100644--- a/tests/hermes_cli/test_launchd_plist_guard.py+++ b/tests/hermes_cli/test_launchd_plist_guard.py@@ -59,7 +59,7 @@ def test_malformed_sibling_does_not_hide_the_good_job(tmp_path):jobs = main_dashboard._loaded_launchd_backend_jobs([("agent", tmp_path)])assert jobs == [(- f"gui/{os.getuid()}", # windows-footgun: ok — macos_only file+ f"gui/{os.getuid()}", # windows-footgun: ok — platforms("macos") file"ai.hermes.dashboard.test",["/usr/local/bin/hermes", "dashboard", "--port", "9119"],4321,diff --git a/tests/hermes_cli/test_relaunch.py b/tests/hermes_cli/test_relaunch.pyindex e9f131d009a..37e0f358e76 100644--- a/tests/hermes_cli/test_relaunch.py+++ b/tests/hermes_cli/test_relaunch.py@@ -108,7 +108,7 @@ class TestRelaunch:hermes). relaunch() must detect win32 and use subprocess.run +sys.exit instead.- ``windows_only``: the bug is that ``os.execvp`` cannot exec a Windows+ ``platforms("windows")``: the bug is that ``os.execvp`` cannot exec a Windowsconsole-script shim. On Linux ``execvp`` works fine, so a patchedplatform only re-asserted the branch we wrote, never the constraintthat motivated it.@@ -116,7 +116,7 @@ class TestRelaunch:monkeypatch.setattr(relaunch_mod, "resolve_hermes_bin", lambda: r"C:\Users\test\hermes.exe")# Pin sys.argv: relaunch() preserves inherited flags from the LIVE# argv, so under pytest it happily inherited the runner's own- # "-m 'windows_only and not integration'" and the assertion below saw+ # "-m 'platforms and not integration'" and the assertion below saw# them in the child argv. Nothing to do with Windows — it only showed# up here because this is the first lane that actually executes the# test, and -m is how that lane selects it.@@ -177,7 +177,7 @@ class TestResolveHermesBinWindowsPyGuard:subprocess.run can't actually exec a .py directly, so the relaunchwould fail with the cryptic "%1 is not a valid Win32 application" error.- The Windows cases are ``windows_only``: the PATHEXT-driven ``os.access``+ The Windows cases are ``platforms("windows")``: the PATHEXT-driven ``os.access``result the guard defends against simply does not occur on POSIX, so afaked ``sys.platform`` could never reproduce the hazard."""diff --git a/tests/hermes_cli/test_slash_confirm_windows.py b/tests/hermes_cli/test_slash_confirm_windows.pyindex a88301feeac..08921d53e29 100644--- a/tests/hermes_cli/test_slash_confirm_windows.py+++ b/tests/hermes_cli/test_slash_confirm_windows.py@@ -16,7 +16,7 @@ These tests verify:(on win32, off-thread) a scheduling failure degrades to a clean cancel.4. Empty choices returns None.-**Why the Windows cases are ``windows_only`` rather than ``sys.platform``+**Why the Windows cases are ``platforms("windows")`` rather than ``sys.platform``patches.** The deadlock #33961 fixed is a real property of the Windows console:a raw ``input()`` off the main thread blocks forever against prompt_toolkit'sstdin ownership. On Linux the same call returns immediately (or EOFs), so a test@@ -159,7 +159,7 @@ class TestConfirmDestructiveSlash:This is the flow bug #33961 froze on native Windows. The fix made itplatform-agnostic (modal via the app loop), so the assertion holds onwhichever host runs it. The class carries no OS marker, so the- ``windows_only`` lane deselects it — the deadlock tests above are the+ ``-m platforms`` Windows lane deselects it — the deadlock tests above are theWindows-side regression guard."""@@ -214,7 +214,7 @@ class TestNativeWindowsNoRawInputDeadlock:pre-#33961 code (win32 → ``_prompt_text_input`` → off-main ``input()``)and pass once the modal path / clean-cancel fallback is in place.- ``windows_only``: the deadlock is a property of the Windows console's stdin+ ``platforms("windows")``: the deadlock is a property of the Windows console's stdinownership. Running this with a patched ``sys.platform`` on Linux exercisesa blocking ``input()`` that does not actually deadlock there, so it couldnever have caught the regression it is named for.diff --git a/tests/hermes_cli/test_update_stale_dashboard.py b/tests/hermes_cli/test_update_stale_dashboard.pyindex 344116bc69e..27f137c973d 100644--- a/tests/hermes_cli/test_update_stale_dashboard.py+++ b/tests/hermes_cli/test_update_stale_dashboard.py@@ -253,7 +253,7 @@ class TestKillStaleDashboardWindows:@pytest.mark.platforms("windows")def test_taskkill_invoked_for_each_pid(self, capsys):- """``windows_only``: ``taskkill.exe`` only exists on Windows, and the+ """``platforms("windows")``: ``taskkill.exe`` only exists on Windows, and thefaked platform also silently skipped the POSIX-only cgroup/argvsnapshot the real Windows path must not take."""@@ -716,7 +716,7 @@ class TestCmdlineCapture:@pytest.mark.platforms("windows")def test_returns_none_on_windows(self):- """``windows_only``: the contract is "no graceful-argv capture on a+ """``platforms("windows")``: the contract is "no graceful-argv capture on areal Windows host" — asserting it against a faked platform onlyrestated the branch condition."""diff --git a/tests/scripts/test_powershell_script_syntax.py b/tests/scripts/test_powershell_script_syntax.pyindex a4911024c24..eff889b9887 100644--- a/tests/scripts/test_powershell_script_syntax.py+++ b/tests/scripts/test_powershell_script_syntax.py@@ -3,7 +3,7 @@install.ps1 is fetched standalone (``irm | iex``) by every Windows user, soa parse error ships instantly and breaks installs at line 1. Linux CI cannotexecute PowerShell, which is why the other install_ps1 tests are source-regex-probes; this test runs on the ``windows_only`` lane (tests-os.yml), where a+probes; this test runs on the ``platforms("windows")`` lane (tests-os.yml), where aPowerShell host is part of the OS, and asks the actual language parser.The harness is written to a file and invoked with ``-File`` because inlinediff --git a/tests/tools/test_windows_native_support.py b/tests/tools/test_windows_native_support.pyindex c51a526ee46..a59026a1035 100644--- a/tests/tools/test_windows_native_support.py+++ b/tests/tools/test_windows_native_support.py@@ -1,7 +1,7 @@"""Behavioral tests for Windows-specific compatibility fixes.Host-independent tests run everywhere; tests that need a real Windows host-are marked ``windows_only`` (they mock only dependencies such as+are marked ``platforms("windows")`` (they mock only dependencies such as``subprocess.run`` / ``os.kill``, never ``sys.platform``)."""