The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
test: drop tests that cannot fail or duplicate a same-file keeper
kshitijk4poor9ee791eef1b5
diff --git a/tests/agent/test_auxiliary_client_base_url_host_validation.py b/tests/agent/test_auxiliary_client_base_url_host_validation.pyindex aec56502661..85aad4f1160 100644--- a/tests/agent/test_auxiliary_client_base_url_host_validation.py+++ b/tests/agent/test_auxiliary_client_base_url_host_validation.py@@ -122,19 +122,6 @@ class TestTryAnthropicBaseUrlHostValidation:f"Non-Anthropic host must not be applied. Got: {actual!r}")- def test_empty_base_url_falls_back_to_default(self, tmp_path, monkeypatch):- """Empty model.base_url must not crash and must fall back to default."""- import hermes_yaml as yaml- from agent.auxiliary_client import _try_anthropic- monkeypatch.setenv("HERMES_HOME", str(tmp_path))- (tmp_path / "config.yaml").write_text(yaml.safe_dump({- "model": {- "provider": "anthropic",- "model": "claude-haiku-4-5-20251001",- "base_url": "",- }- }))-def test_anthropic_suffix_gateway_base_url_is_applied(self, tmp_path, monkeypatch):"""A gateway exposing the Messages protocol under a ``/anthropic`` suffixdiff --git a/tests/agent/test_background_review_usage.py b/tests/agent/test_background_review_usage.pyindex 0e7802c86bd..ea7c1b8ea32 100644--- a/tests/agent/test_background_review_usage.py+++ b/tests/agent/test_background_review_usage.py@@ -96,9 +96,6 @@ def test_noop_when_fork_made_no_calls(db):assert _usage_rows(db, "sess-parent") == []-def test_noop_when_parent_has_no_session_db():- background_review._record_review_usage_to_parent(_FakeParent(None), _usage())-def test_noop_when_parent_has_no_session_id(db):db.create_session("sess-parent", source="cli")diff --git a/tests/cron/test_cron_direct_api_call.py b/tests/cron/test_cron_direct_api_call.pyindex ccea3f8f61f..b963299e582 100644--- a/tests/cron/test_cron_direct_api_call.py+++ b/tests/cron/test_cron_direct_api_call.py@@ -13,7 +13,6 @@ from unittest.mock import MagicMockfrom agent.chat_completion_helpers import (direct_api_call,- should_use_direct_api_call,)@@ -29,26 +28,6 @@ def _make_agent(*, platform="cron"):return agent-def test_should_use_direct_api_call_only_for_cron_openai_wire():- assert should_use_direct_api_call(_make_agent(platform="cron")) is True- assert should_use_direct_api_call(_make_agent(platform="cli")) is False- assert should_use_direct_api_call(_make_agent(platform="telegram")) is False- assert should_use_direct_api_call(_make_agent(platform=None)) is False-- codex = _make_agent(platform="cron")- codex.api_mode = "codex_responses"- assert should_use_direct_api_call(codex) is True # #69734-- for api_mode in ("anthropic_messages", "bedrock_converse"):- agent = _make_agent(platform="cron")- agent.api_mode = api_mode- assert should_use_direct_api_call(agent) is False-- moa = _make_agent(platform="cron")- moa.provider = "moa"- assert should_use_direct_api_call(moa) is False--def test_direct_api_call_keeps_activity_alive_during_slow_wait(monkeypatch):diff --git a/tests/cron/test_cronjob_gateway_liveness.py b/tests/cron/test_cronjob_gateway_liveness.pyindex f494261558f..edf3565002d 100644--- a/tests/cron/test_cronjob_gateway_liveness.py+++ b/tests/cron/test_cronjob_gateway_liveness.py@@ -289,19 +289,3 @@ class TestRuntimeLockFirstLiveness:),):assert cron_cli._builtin_gateway_liveness() is True-- def test_no_multiplexer_and_no_pids_is_still_false(self):- from unittest.mock import patch-- import hermes_cli.cron as cron_cli-- with (- patch("hermes_cli.cron._active_cron_provider_name", return_value="builtin"),- patch("gateway.status.is_gateway_runtime_lock_active", return_value=False),- patch("hermes_cli.gateway.find_gateway_pids", return_value=[]),- patch(- "hermes_cli.gateway.named_profile_served_by_running_multiplexer",- return_value=False,- ),- ):- assert cron_cli._builtin_gateway_liveness() is Falsediff --git a/tests/hermes_state/test_hermes_state.py b/tests/hermes_state/test_hermes_state.pyindex 079a972e3c1..49020057ba9 100644--- a/tests/hermes_state/test_hermes_state.py+++ b/tests/hermes_state/test_hermes_state.py@@ -2522,27 +2522,6 @@ class TestFtsRebuildLoopWithoutTrigram:db.close()-class TestTitleUniqueness:- """Tests for unique title enforcement and title-based lookups."""-- def test_duplicate_title_raises(self, db):- """Setting a title already used by another session raises ValueError."""- db.create_session("s1", "cli")- db.create_session("s2", "cli")- db.set_session_title("s1", "my project")- with pytest.raises(ValueError, match="already in use"):- db.set_session_title("s2", "my project")--- def test_null_titles_not_unique(self, db):- """Multiple sessions can have NULL titles (no constraint violation)."""- db.create_session("s1", "cli")- db.create_session("s2", "cli")- # Both have NULL titles — no error- assert db.get_session("s1")["title"] is None- assert db.get_session("s2")["title"] is None--diff --git a/tests/tools/test_browser_console_ssrf.py b/tests/tools/test_browser_console_ssrf.pyindex d2159bfab66..f445c5ff04d 100644--- a/tests/tools/test_browser_console_ssrf.py+++ b/tests/tools/test_browser_console_ssrf.py@@ -77,15 +77,6 @@ def test_skips_guard_for_local_backend(monkeypatch):assert result["total_messages"] == 1-def test_skips_guard_when_private_urls_allowed(monkeypatch):- _mock_run_success(monkeypatch)- monkeypatch.setattr(bt_eval_policy, "_eval_ssrf_guard_active", lambda tid: False)-- result = json.loads(browser_tool.browser_console(task_id="test"))- assert result["success"] is True- assert result["total_messages"] == 1--def test_guard_does_not_block_on_failed_console_command(monkeypatch):"""If the console command itself fails, browser_console returns the error naturally."""def _run(task_id, command, args=None, **kwargs):diff --git a/tests/tools/test_browser_get_images_ssrf.py b/tests/tools/test_browser_get_images_ssrf.pyindex 8359d800358..09ab37f4c01 100644--- a/tests/tools/test_browser_get_images_ssrf.py+++ b/tests/tools/test_browser_get_images_ssrf.py@@ -65,15 +65,6 @@ def test_skips_guard_for_local_backend(monkeypatch):assert result["count"] == 1-def test_skips_guard_when_private_urls_allowed(monkeypatch):- _mock_run_success(monkeypatch)- monkeypatch.setattr(bt_eval_policy, "_eval_ssrf_guard_active", lambda tid: False)-- result = json.loads(browser_tool.browser_get_images(task_id="test"))- assert result["success"] is True- assert result["count"] == 1--def test_guard_does_not_block_on_failed_eval(monkeypatch):"""If the eval itself fails, browser_get_images returns its own error — no guard needed."""def _run(task_id, command, args=None, **kwargs):diff --git a/tests/tools/test_code_execution_windows_env.py b/tests/tools/test_code_execution_windows_env.pyindex 46096a7e657..ef6924b936d 100644--- a/tests/tools/test_code_execution_windows_env.py+++ b/tests/tools/test_code_execution_windows_env.py@@ -84,102 +84,6 @@ class TestWindowsSocketSmokeTest:f" scrubbed keys={sorted(scrubbed.keys())}")assert "OK" in result.stdout---class TestNativeLegacyEncodingControls:- @pytest.mark.platforms("windows")- def test_windows_default_encoding_would_have_failed(self):- """Negative control: prove that on Windows, writing the stub- *without* ``encoding="utf-8"`` would corrupt the file. If this- test ever starts failing (i.e. default write succeeds), it means- Python's default encoding has changed and the explicit UTF-8- requirement may be obsolete — reconsider the fix."""- from tools.code_execution_tool import generate_hermes_tools_module- import tempfile-- stub = generate_hermes_tools_module(["terminal"], transport="uds")- # Find a non-ASCII character we can use to prove the corruption.- non_ascii = [c for c in stub if ord(c) > 127]- if not non_ascii:- pytest.skip("stub has no non-ASCII chars — nothing to corrupt")-- # Write with default encoding (simulating the old buggy code).- with tempfile.NamedTemporaryFile(- mode="w", suffix=".py", delete=False- ) as f:- try:- f.write(stub)- tmp_path = f.name- wrote_successfully = True- except UnicodeEncodeError:- # Default encoding can't even encode it — that's the bug- # in a different form. Still proves the point.- tmp_path = f.name- wrote_successfully = False-- try:- if not wrote_successfully:- # Default-encoding write raised outright. The bug is real.- return-- # Read back as UTF-8 (what Python does on import).- with open(tmp_path, encoding="utf-8") as fh:- try:- fh.read()- # If this succeeds on Windows, the platform default is- # already UTF-8 (e.g. Python 3.15 with UTF-8 mode on).- # In that case the explicit encoding= is belt-and-- # suspenders but no longer strictly required. Skip.- pytest.skip(- "Default text-file encoding is UTF-8-compatible on "- "this Windows build — explicit encoding= is no "- "longer load-bearing, but keep it for belt-and-"- "suspenders."- )- except UnicodeDecodeError:- # Exactly the failure mode that motivated the fix.- pass- finally:- os.unlink(tmp_path)-- @pytest.mark.platforms("windows")- def test_windows_child_without_utf8_env_would_fail(self):- """Negative control: spawn a Python child *without* our env- overrides and prove that on Windows, printing non-ASCII fails.- If this ever starts passing, Python has changed its default- stdio encoding on Windows and the fix may be obsolete — but- keep the env vars anyway for belt-and-suspenders."""- script = textwrap.dedent("""- import sys- print("em-dash \\u2014 arrow \\u2192")- sys.exit(0)- """).strip()-- # Scrubbed env WITHOUT the PYTHONIOENCODING / PYTHONUTF8 overrides.- # Also scrub PYTHONUTF8 and PYTHONIOENCODING from the inherited- # env so we reproduce the buggy state even if the parent test- # runner has them set.- scrubbed = _scrub_child_env(os.environ, is_passthrough=_no_passthrough)- for k in ("PYTHONIOENCODING", "PYTHONUTF8", "PYTHONLEGACYWINDOWSSTDIO"):- scrubbed.pop(k, None)-- result = subprocess.run(- [sys.executable, "-c", script],- env=scrubbed,- capture_output=True,- text=False,- timeout=15,- )- # Either the child crashed (expected), or modern Python handled- # it anyway — in which case the fix is still defensive but no- # longer strictly required. Skip with a note if so.- if result.returncode == 0 and b"\xe2\x80\x94" in result.stdout:- pytest.skip(- "This Python/Windows build handles non-ASCII stdout even "- "without PYTHONIOENCODING/PYTHONUTF8 — fix is defensive "- "but no longer strictly load-bearing. Keep the env vars "- "for older Python builds and C.ASCII-locale containers."- )# Otherwise: crash OR garbled output — both count as proving the# bug is real on this system.