litellm/tests/unit/conftest.py
yuneng 446bd1b250 ci(tests): wire tests/unit into CircleCI and drain legacy unit shards green
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-20 07:05:42 +00:00

16 lines
446 B
Python

from collections.abc import Iterator
import pytest
from pytest_socket import enable_socket, socket_allow_hosts
@pytest.fixture(autouse=True, scope="session")
def block_external_sockets() -> Iterator[None]:
socket_allow_hosts(["127.0.0.1", "::1"], allow_unix_socket=True)
yield
enable_socket()
@pytest.hookimpl(trylast=True)
def pytest_runtest_setup() -> None:
socket_allow_hosts(["127.0.0.1", "::1"], allow_unix_socket=True)