File tree Expand file tree Collapse file tree 1 file changed +8
-14
lines changed Expand file tree Collapse file tree 1 file changed +8
-14
lines changed Original file line number Diff line number Diff line change @@ -301,23 +301,17 @@ def rollback(self) -> None:
301301 assert "sqlite://****:****@homeassistant.local" in caplog .text
302302
303303
304- async def test_query_from_yaml (recorder_mock : Recorder , hass : HomeAssistant ) -> None :
305- """Test the SQL sensor from yaml config."""
306-
307- assert await async_setup_component (hass , DOMAIN , YAML_CONFIG )
308- await hass .async_block_till_done ()
309-
310- state = hass .states .get ("sensor.get_value" )
311- assert state .state == "5"
312-
313-
314- async def test_async_query_from_yaml (
315- recorder_mock : Recorder , hass : HomeAssistant
304+ @pytest .mark .parametrize ("async_driver" , [False , True ])
305+ async def test_query_from_yaml (
306+ recorder_mock : Recorder , hass : HomeAssistant , async_driver : bool
316307) -> None :
317308 """Test the SQL sensor from yaml config using async driver."""
318309
319- config = copy .deepcopy (YAML_CONFIG )
320- config ["sql" ][CONF_DB_URL ] = "sqlite+aiosqlite://"
310+ config = YAML_CONFIG
311+
312+ if async_driver :
313+ config = copy .deepcopy (YAML_CONFIG )
314+ config ["sql" ][CONF_DB_URL ] = "sqlite+aiosqlite://"
321315
322316 assert await async_setup_component (hass , DOMAIN , config )
323317 await hass .async_block_till_done ()
You can’t perform that action at this time.
0 commit comments