1
0
mirror of https://github.com/home-assistant/core.git synced 2026-04-02 00:20:30 +01:00

Improve SNMP tests and avoid dns lookups (#166604)

This commit is contained in:
Simone Chemelli
2026-03-31 13:54:40 +02:00
committed by GitHub
parent c82cfaf633
commit cb8597d62f

View File

@@ -0,0 +1,13 @@
"""Conftest for SNMP tests."""
import socket
from unittest.mock import patch
import pytest
@pytest.fixture(autouse=True)
def patch_gethostbyname():
"""Patch gethostbyname to avoid DNS lookups in SNMP tests."""
with patch.object(socket, "gethostbyname"):
yield