Skip to content

Commit

Permalink
Override aiohttp_client in some integrations
Browse files Browse the repository at this point in the history
  • Loading branch information
emontnemery committed Sep 19, 2021
1 parent 1c07fc5 commit 845e917
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/components/auth/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"""Test configuration for auth."""
import pytest


@pytest.fixture
def aiohttp_client(loop, aiohttp_client, socket_enabled):
"""Return aiohttp_client and allow opening sockets."""
return aiohttp_client
6 changes: 6 additions & 0 deletions tests/components/emulated_hue/test_upnp.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ def sendto(self, response, addr):
self.sends.append((response, addr))


@pytest.fixture
def aiohttp_client(loop, aiohttp_client, socket_enabled):
"""Return aiohttp_client and allow opening sockets."""
return aiohttp_client


@pytest.fixture
def hue_client(aiohttp_client):
"""Return a hue API client."""
Expand Down
6 changes: 6 additions & 0 deletions tests/components/frontend/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ async def frontend_themes(hass):
)


@pytest.fixture
def aiohttp_client(loop, aiohttp_client, socket_enabled):
"""Return aiohttp_client and allow opening sockets."""
return aiohttp_client


@pytest.fixture
async def mock_http_client(hass, aiohttp_client, frontend):
"""Start the Home Assistant HTTP component."""
Expand Down
8 changes: 8 additions & 0 deletions tests/components/http/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"""Test configuration for http."""
import pytest


@pytest.fixture
def aiohttp_client(loop, aiohttp_client, socket_enabled):
"""Return aiohttp_client and allow opening sockets."""
return aiohttp_client
6 changes: 6 additions & 0 deletions tests/components/nest/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ async def response_handler(self, request):
return aiohttp.web.json_response()


@pytest.fixture
def aiohttp_client(loop, aiohttp_client, socket_enabled):
"""Return aiohttp_client and allow opening sockets."""
return aiohttp_client


@pytest.fixture
async def auth(aiohttp_client):
"""Fixture for an AbstractAuth."""
Expand Down

0 comments on commit 845e917

Please sign in to comment.