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:
13
tests/components/snmp/conftest.py
Normal file
13
tests/components/snmp/conftest.py
Normal 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
|
||||
Reference in New Issue
Block a user