From 1af109c79cefea8fd47d0059363e48fbc79daa5d Mon Sep 17 00:00:00 2001 From: Brooklyn Nicholson Date: Sun, 28 Jun 2026 23:24:45 -0500 Subject: [PATCH] test(cli): drop pytest dep + use real sentinel handlers in serve test Clears the ty diff bot's warnings on the new test: pass real callables to build_dashboard_parser (not object()) and replace the pytest.mark.parametrize with a plain loop so the file is stdlib-only. --- tests/hermes_cli/test_serve_command.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/tests/hermes_cli/test_serve_command.py b/tests/hermes_cli/test_serve_command.py index 6b1f566cfcd..19db4b82380 100644 --- a/tests/hermes_cli/test_serve_command.py +++ b/tests/hermes_cli/test_serve_command.py @@ -13,27 +13,30 @@ from __future__ import annotations import argparse -import pytest - from hermes_cli.subcommands.dashboard import build_dashboard_parser -_DASH = object() -_REGISTER = object() + +def _dash(args): # sentinel handler — identity-compared, never invoked + return args + + +def _register(args): + return args def _parser() -> argparse.ArgumentParser: parser = argparse.ArgumentParser() build_dashboard_parser( parser.add_subparsers(dest="command"), - cmd_dashboard=_DASH, - cmd_dashboard_register=_REGISTER, + cmd_dashboard=_dash, + cmd_dashboard_register=_register, ) return parser def test_serve_routes_to_the_shared_dashboard_handler(): args = _parser().parse_args(["serve"]) - assert args.func is _DASH + assert args.func is _dash def test_serve_is_headless_by_default_but_dashboard_is_not(): @@ -55,6 +58,6 @@ def test_serve_takes_the_same_runtime_flags_as_dashboard(): assert getattr(serve, field) == getattr(dash, field) -@pytest.mark.parametrize("flag", ["--stop", "--status"]) -def test_serve_supports_the_lifecycle_flags(flag): - assert getattr(_parser().parse_args(["serve", flag]), flag.lstrip("-")) is True +def test_serve_supports_the_lifecycle_flags(): + for flag in ("--stop", "--status"): + assert getattr(_parser().parse_args(["serve", flag]), flag.lstrip("-")) is True