From 73da736ebb4c9e575221192947afe82f84a7e6e5 Mon Sep 17 00:00:00 2001 From: Simone Chemelli Date: Wed, 1 Apr 2026 18:55:53 +0200 Subject: [PATCH] Patch the correct socket method in SNMP (#167081) --- tests/components/snmp/conftest.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/components/snmp/conftest.py b/tests/components/snmp/conftest.py index 1ed2f456c8a..8626e2497b4 100644 --- a/tests/components/snmp/conftest.py +++ b/tests/components/snmp/conftest.py @@ -7,7 +7,7 @@ import pytest @pytest.fixture(autouse=True) -def patch_gethostbyname(): - """Patch gethostbyname to avoid DNS lookups in SNMP tests.""" - with patch.object(socket, "gethostbyname"): +def patch_getaddrinfo(): + """Patch getaddrinfo to avoid DNS lookups in SNMP tests.""" + with patch.object(socket, "getaddrinfo"): yield