From 0aea34f49d765c61d0420341bea6c6c9194c8934 Mon Sep 17 00:00:00 2001 From: "spyroot@gmail.com" Date: Thu, 23 Jul 2026 12:02:39 +0400 Subject: [PATCH] Remove duplicate _reset_command_singletons fixture in tests/conftest.py The autouse fixture was defined twice at module scope; the second definition silently shadowed the first. Bodies were identical, so keep the first copy, which has the fuller docstring (documents that the command dispatch _registry is untouched). --- tests/conftest.py | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 94d3567f..b9644920 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -236,22 +236,6 @@ def _make_idrac(idrac_ip, username, password): ) -@pytest.fixture(autouse=True) -def _reset_command_singletons(): - """Give every test fresh command singletons so no cached state leaks. - - Commands use ``metaclass=Singleton`` and cache per-host state - (``idrac_manage_servers`` and friends) on the instance. Without a reset, the - first vendor a command sees wins for the whole session — which only bites - cross-vendor tests (e.g. Supermicro then HPE resolve different host ids). - Clearing the instance registry before each test isolates them. - """ - from redfish_ctl.idrac_shared import Singleton - Singleton._instances.clear() - yield - Singleton._instances.clear() - - @pytest.fixture def redfish_service(): """The bare MockRedfishService mounted on a ``requests-mock`` transport.