diff --git a/tests/components/api/test_init.py b/tests/components/api/test_init.py index ffda908a29b..cb3247f43cb 100644 --- a/tests/components/api/test_init.py +++ b/tests/components/api/test_init.py @@ -382,11 +382,13 @@ def _listen_count(hass): return sum(hass.bus.async_listeners().values()) -async def test_api_error_log(hass, aiohttp_client, hass_access_token, hass_admin_user): +async def test_api_error_log( + hass, hass_client_no_auth, hass_access_token, hass_admin_user +): """Test if we can fetch the error log.""" hass.data[DATA_LOGGING] = "/some/path" await async_setup_component(hass, "api", {}) - client = await aiohttp_client(hass.http.app) + client = await hass_client_no_auth() resp = await client.get(const.URL_API_ERROR_LOG) # Verify auth required diff --git a/tests/components/august/test_camera.py b/tests/components/august/test_camera.py index 151f7972e1e..bc9cd5d2bd7 100644 --- a/tests/components/august/test_camera.py +++ b/tests/components/august/test_camera.py @@ -10,7 +10,7 @@ from tests.components.august.mocks import ( ) -async def test_create_doorbell(hass, aiohttp_client): +async def test_create_doorbell(hass, hass_client_no_auth): """Test creation of a doorbell.""" doorbell_one = await _mock_doorbell_from_fixture(hass, "get_doorbell.json") @@ -28,7 +28,7 @@ async def test_create_doorbell(hass, aiohttp_client): "entity_picture" ] - client = await aiohttp_client(hass.http.app) + client = await hass_client_no_auth() resp = await client.get(url) assert resp.status == 200 body = await resp.text() diff --git a/tests/components/dialogflow/test_init.py b/tests/components/dialogflow/test_init.py index c2d0316245a..1f5b5bccfa9 100644 --- a/tests/components/dialogflow/test_init.py +++ b/tests/components/dialogflow/test_init.py @@ -34,7 +34,7 @@ async def calls(hass, fixture): @pytest.fixture -async def fixture(hass, aiohttp_client): +async def fixture(hass, hass_client_no_auth): """Initialize a Home Assistant server for testing this module.""" await async_setup_component(hass, dialogflow.DOMAIN, {"dialogflow": {}}) await async_setup_component( @@ -92,7 +92,7 @@ async def fixture(hass, aiohttp_client): assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY webhook_id = result["result"].data["webhook_id"] - return await aiohttp_client(hass.http.app), webhook_id + return await hass_client_no_auth(), webhook_id class _Data: diff --git a/tests/components/emulated_hue/test_hue_api.py b/tests/components/emulated_hue/test_hue_api.py index f9df29e16ae..8515d4e4b0c 100644 --- a/tests/components/emulated_hue/test_hue_api.py +++ b/tests/components/emulated_hue/test_hue_api.py @@ -209,7 +209,7 @@ def hass_hue(loop, hass): @pytest.fixture -def hue_client(loop, hass_hue, aiohttp_client): +def hue_client(loop, hass_hue, hass_client_no_auth): """Create web client for emulated hue api.""" web_app = hass_hue.http.app config = Config( @@ -255,7 +255,7 @@ def hue_client(loop, hass_hue, aiohttp_client): HueFullStateView(config).register(web_app, web_app.router) HueConfigView(config).register(web_app, web_app.router) - return loop.run_until_complete(aiohttp_client(web_app)) + return loop.run_until_complete(hass_client_no_auth()) async def test_discover_lights(hue_client): @@ -302,7 +302,7 @@ async def test_light_without_brightness_supported(hass_hue, hue_client): assert light_without_brightness_json["type"] == "On/Off light" -async def test_lights_all_dimmable(hass, aiohttp_client): +async def test_lights_all_dimmable(hass, hass_client_no_auth): """Test CONF_LIGHTS_ALL_DIMMABLE.""" # create a lamp without brightness support hass.states.async_set("light.no_brightness", "on", {}) @@ -326,7 +326,7 @@ async def test_lights_all_dimmable(hass, aiohttp_client): config.numbers = ENTITY_IDS_BY_NUMBER web_app = hass.http.app HueOneLightStateView(config).register(web_app, web_app.router) - client = await aiohttp_client(web_app) + client = await hass_client_no_auth() light_without_brightness_json = await perform_get_light_state( client, "light.no_brightness", HTTP_OK ) diff --git a/tests/components/geofency/test_init.py b/tests/components/geofency/test_init.py index 169cfebae17..8646eac19a2 100644 --- a/tests/components/geofency/test_init.py +++ b/tests/components/geofency/test_init.py @@ -118,7 +118,7 @@ def mock_dev_track(mock_device_tracker_conf): @pytest.fixture -async def geofency_client(loop, hass, aiohttp_client): +async def geofency_client(loop, hass, hass_client_no_auth): """Geofency mock client (unauthenticated).""" assert await async_setup_component(hass, "persistent_notification", {}) @@ -128,7 +128,7 @@ async def geofency_client(loop, hass, aiohttp_client): await hass.async_block_till_done() with patch("homeassistant.components.device_tracker.legacy.update_config"): - return await aiohttp_client(hass.http.app) + return await hass_client_no_auth() @pytest.fixture(autouse=True) diff --git a/tests/components/google_assistant/test_google_assistant.py b/tests/components/google_assistant/test_google_assistant.py index 2c3a61b8beb..397b4c309a7 100644 --- a/tests/components/google_assistant/test_google_assistant.py +++ b/tests/components/google_assistant/test_google_assistant.py @@ -36,7 +36,7 @@ def auth_header(hass_access_token): @pytest.fixture -def assistant_client(loop, hass, aiohttp_client): +def assistant_client(loop, hass, hass_client_no_auth): """Create web client for the Google Assistant API.""" loop.run_until_complete( setup.async_setup_component( @@ -56,7 +56,7 @@ def assistant_client(loop, hass, aiohttp_client): ) ) - return loop.run_until_complete(aiohttp_client(hass.http.app)) + return loop.run_until_complete(hass_client_no_auth()) @pytest.fixture diff --git a/tests/components/gpslogger/test_init.py b/tests/components/gpslogger/test_init.py index 61e5862d3b1..4305b8d5642 100644 --- a/tests/components/gpslogger/test_init.py +++ b/tests/components/gpslogger/test_init.py @@ -31,7 +31,7 @@ def mock_dev_track(mock_device_tracker_conf): @pytest.fixture -async def gpslogger_client(loop, hass, aiohttp_client): +async def gpslogger_client(loop, hass, hass_client_no_auth): """Mock client for GPSLogger (unauthenticated).""" assert await async_setup_component(hass, "persistent_notification", {}) @@ -40,7 +40,7 @@ async def gpslogger_client(loop, hass, aiohttp_client): await hass.async_block_till_done() with patch("homeassistant.components.device_tracker.legacy.update_config"): - return await aiohttp_client(hass.http.app) + return await hass_client_no_auth() @pytest.fixture(autouse=True)