test(hubris): use monkeypatch for disable_aiohttp_transport (TQ005)

This commit is contained in:
Konstantin 2026-09-05 17:48:51 +03:00
parent 20e6078c40
commit ef3ec4f6bc

View file

@ -147,11 +147,9 @@ class TestHubrisDynamicConfig:
class TestHubrisCompletion:
@pytest.fixture(autouse=True)
def _disable_aiohttp(self):
original = getattr(litellm, "disable_aiohttp_transport", False)
litellm.disable_aiohttp_transport = True
yield
litellm.disable_aiohttp_transport = original
def _disable_aiohttp(self, monkeypatch):
# respx mocks the httpx transport, so the aiohttp transport must be off.
monkeypatch.setattr(litellm, "disable_aiohttp_transport", True)
@pytest.mark.respx()
def test_completion_sends_correct_url_and_body(self, respx_mock):