diff --git a/tests/acp/test_events.py b/tests/acp/test_events.py index 025245ba0a9..45fd9569b00 100644 --- a/tests/acp/test_events.py +++ b/tests/acp/test_events.py @@ -410,8 +410,8 @@ class TestSendUpdate: assert created["coro"] is not None assert created["coro"].cr_frame is None - # Only count warnings about THIS test's coroutine; other tests in the - # same xdist worker (or stdlib mock internals) may emit unrelated + # Only count warnings about THIS test's coroutine; other tests + # may emit unrelated # "coroutine was never awaited" warnings that bleed through. runtime_warnings = [ w for w in caught diff --git a/tests/agent/test_async_utils.py b/tests/agent/test_async_utils.py index 8354384c34e..8094c2cfd21 100644 --- a/tests/agent/test_async_utils.py +++ b/tests/agent/test_async_utils.py @@ -20,8 +20,7 @@ def _no_unawaited_warnings(caught, *, coro_name: str = "") -> bool: """Return True if no "X was never awaited" warning slipped through. When *coro_name* is provided, only warnings naming that coroutine are - counted — xdist workers may emit unrelated unawaited-coroutine warnings - (e.g. ``AsyncMockMixin._execute_mock_call``) from concurrent tests. + counted """ bad = [ w for w in caught diff --git a/tests/agent/test_skill_commands_reload.py b/tests/agent/test_skill_commands_reload.py index ee77141d197..76a825e63f6 100644 --- a/tests/agent/test_skill_commands_reload.py +++ b/tests/agent/test_skill_commands_reload.py @@ -39,10 +39,9 @@ def _write_skill(skills_dir: Path, name: str, description: str = "") -> Path: def hermes_home(monkeypatch): """Isolate HERMES_HOME for ``reload_skills`` tests. - Rather than popping cache-bearing modules from ``sys.modules`` (which - races against pytest-xdist's parallel workers), we monkeypatch the - module-level ``HERMES_HOME`` / ``SKILLS_DIR`` constants in place so the - isolation is local to this fixture's scope. + Rather than popping cache-bearing modules from ``sys.modules``, + we monkeypatch the module-level ``HERMES_HOME`` / ``SKILLS_DIR`` + constants in place so the isolation is local to this fixture's scope. """ td = tempfile.mkdtemp(prefix="hermes-reload-skills-") monkeypatch.setenv("HERMES_HOME", td) diff --git a/tests/cli/test_cli_provider_resolution.py b/tests/cli/test_cli_provider_resolution.py index a5b37742ad6..d1500723f87 100644 --- a/tests/cli/test_cli_provider_resolution.py +++ b/tests/cli/test_cli_provider_resolution.py @@ -13,7 +13,7 @@ from hermes_cli import main as hermes_main # --------------------------------------------------------------------------- # Module isolation: _import_cli() wipes tools.* / cli / run_agent from # sys.modules so it can re-import cli fresh. Without cleanup the wiped -# modules leak into subsequent tests on the same xdist worker, breaking +# modules leak into subsequent tests, breaking # mock patches that target "tools.file_tools._get_file_ops" etc. # --------------------------------------------------------------------------- diff --git a/tests/cli/test_quick_commands.py b/tests/cli/test_quick_commands.py index 5f4ce2d32ac..4029d97e731 100644 --- a/tests/cli/test_quick_commands.py +++ b/tests/cli/test_quick_commands.py @@ -184,8 +184,7 @@ class TestGatewayQuickCommands: from gateway.run import GatewayRunner # Ensure redaction is active regardless of host HERMES_REDACT_SECRETS state - # or test ordering (the module snapshots env at import time, so other - # tests in the same xdist worker can flip the flag). + # or test ordering monkeypatch.setattr("agent.redact._REDACT_ENABLED", True) runner = GatewayRunner.__new__(GatewayRunner) diff --git a/tests/hermes_cli/test_dashboard_auth_401_reauth.py b/tests/hermes_cli/test_dashboard_auth_401_reauth.py index 121931b53c0..79c1124e051 100644 --- a/tests/hermes_cli/test_dashboard_auth_401_reauth.py +++ b/tests/hermes_cli/test_dashboard_auth_401_reauth.py @@ -27,7 +27,6 @@ import pytest # against each other (and against any other file that also touches # ``app.state``) — the marker name is shared across all dashboard-auth test # files that gate the app. -pytestmark = pytest.mark.xdist_group("dashboard_auth_app_state") from fastapi import FastAPI from fastapi.responses import Response from fastapi.testclient import TestClient diff --git a/tests/hermes_cli/test_dashboard_auth_gate.py b/tests/hermes_cli/test_dashboard_auth_gate.py index 1094af3b0d7..984dac3f43f 100644 --- a/tests/hermes_cli/test_dashboard_auth_gate.py +++ b/tests/hermes_cli/test_dashboard_auth_gate.py @@ -10,7 +10,6 @@ import pytest # against each other (and against any other file that also touches # ``app.state``) — the marker name is shared across all dashboard-auth test # files that gate the app. -pytestmark = pytest.mark.xdist_group("dashboard_auth_app_state") from fastapi.testclient import TestClient from hermes_cli import web_server diff --git a/tests/hermes_cli/test_dashboard_auth_middleware.py b/tests/hermes_cli/test_dashboard_auth_middleware.py index b78b045d924..c16dda56d1e 100644 --- a/tests/hermes_cli/test_dashboard_auth_middleware.py +++ b/tests/hermes_cli/test_dashboard_auth_middleware.py @@ -16,12 +16,6 @@ from __future__ import annotations import pytest -# Phase 5 / Phase 6: these tests mutate ``web_server.app.state.auth_required`` -# at module level. Run them in the same xdist worker so they don't race -# against each other (and against any other file that also touches -# ``app.state``) — the marker name is shared across all dashboard-auth test -# files that gate the app. -pytestmark = pytest.mark.xdist_group("dashboard_auth_app_state") from fastapi.testclient import TestClient from hermes_cli import web_server diff --git a/tests/hermes_cli/test_dashboard_auth_password_login.py b/tests/hermes_cli/test_dashboard_auth_password_login.py index a863ede5b17..b9508c34e49 100644 --- a/tests/hermes_cli/test_dashboard_auth_password_login.py +++ b/tests/hermes_cli/test_dashboard_auth_password_login.py @@ -16,11 +16,6 @@ import time import pytest -# These tests mutate ``web_server.app.state.auth_required`` at module level, -# so they share the dashboard-auth app-state xdist group to avoid racing -# other gate tests. -pytestmark = pytest.mark.xdist_group("dashboard_auth_app_state") - from fastapi.testclient import TestClient from hermes_cli import web_server diff --git a/tests/hermes_cli/test_dashboard_auth_prefix.py b/tests/hermes_cli/test_dashboard_auth_prefix.py index 62f20be8e46..99619a412db 100644 --- a/tests/hermes_cli/test_dashboard_auth_prefix.py +++ b/tests/hermes_cli/test_dashboard_auth_prefix.py @@ -32,10 +32,6 @@ from __future__ import annotations import pytest -# Same xdist group as the other dashboard-auth tests — they all mutate -# web_server.app.state.auth_required at module level. -pytestmark = pytest.mark.xdist_group("dashboard_auth_app_state") - from fastapi.testclient import TestClient from hermes_cli import web_server diff --git a/tests/hermes_cli/test_dashboard_auth_status_endpoint.py b/tests/hermes_cli/test_dashboard_auth_status_endpoint.py index 277cd03adcb..57cd2764cba 100644 --- a/tests/hermes_cli/test_dashboard_auth_status_endpoint.py +++ b/tests/hermes_cli/test_dashboard_auth_status_endpoint.py @@ -20,10 +20,6 @@ from hermes_cli import web_server from hermes_cli.dashboard_auth import clear_providers, register_provider from tests.hermes_cli.conftest_dashboard_auth import StubAuthProvider -# These tests mutate ``web_server.app.state.auth_required`` so they share -# the same xdist group as the other dashboard-auth gated_app tests. -pytestmark = pytest.mark.xdist_group("dashboard_auth_app_state") - @pytest.fixture def gated_client(): diff --git a/tests/hermes_cli/test_dashboard_auth_ws_auth.py b/tests/hermes_cli/test_dashboard_auth_ws_auth.py index 90969106ad0..c10d8839fac 100644 --- a/tests/hermes_cli/test_dashboard_auth_ws_auth.py +++ b/tests/hermes_cli/test_dashboard_auth_ws_auth.py @@ -17,12 +17,6 @@ from types import SimpleNamespace import pytest -# Phase 5 / Phase 6: these tests mutate ``web_server.app.state.auth_required`` -# at module level. Run them in the same xdist worker so they don't race -# against each other (and against any other file that also touches -# ``app.state``) — the marker name is shared across all dashboard-auth test -# files that gate the app. -pytestmark = pytest.mark.xdist_group("dashboard_auth_app_state") from fastapi.testclient import TestClient from hermes_cli import web_server