"""Collector tests never touch the real network or real DNS - every hostname resolves to a fixed public IP, and respx intercepts the actual HTTP layer per test.""" from __future__ import annotations from unittest.mock import patch import pytest from app.collectors import robots as robots_module @pytest.fixture(autouse=True) def _no_real_dns(): with patch("socket.getaddrinfo", return_value=[(2, 1, 6, "", ("93.184.216.34", 0))]): yield @pytest.fixture(autouse=True) def _reset_robots_cache(): robots_module.clear_cache() yield robots_module.clear_cache()