Fix some pytest warning for helpers (#85283)

This commit is contained in:
Paulus Schoutsen 2023-01-06 03:21:46 -05:00 committed by GitHub
parent f620d2bb2f
commit 9ed629d838
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 11 deletions

View File

@ -238,7 +238,7 @@ async def test_async_async_request_call_without_lock(hass):
job1 = ent_1.async_request_call(ent_1.testhelper(1)) job1 = ent_1.async_request_call(ent_1.testhelper(1))
job2 = ent_2.async_request_call(ent_2.testhelper(2)) job2 = ent_2.async_request_call(ent_2.testhelper(2))
await asyncio.wait([job1, job2]) await asyncio.gather(job1, job2)
while True: while True:
if len(updates) >= 2: if len(updates) >= 2:
break break

View File

@ -28,7 +28,7 @@ from tests.common import MockConfigEntry, mock_platform
TEST_DOMAIN = "test" TEST_DOMAIN = "test"
class TestSchemaConfigFlowHandler(SchemaConfigFlowHandler): class MockSchemaConfigFlowHandler(SchemaConfigFlowHandler):
"""Bare minimum SchemaConfigFlowHandler.""" """Bare minimum SchemaConfigFlowHandler."""
config_flow = {} config_flow = {}
@ -128,7 +128,7 @@ async def test_config_flow_advanced_option(
} }
@manager.mock_reg_handler("test") @manager.mock_reg_handler("test")
class TestFlow(TestSchemaConfigFlowHandler): class TestFlow(MockSchemaConfigFlowHandler):
config_flow = CONFIG_FLOW config_flow = CONFIG_FLOW
# Start flow in basic mode # Start flow in basic mode
@ -222,7 +222,7 @@ async def test_options_flow_advanced_option(
"init": SchemaFlowFormStep(OPTIONS_SCHEMA) "init": SchemaFlowFormStep(OPTIONS_SCHEMA)
} }
class TestFlow(TestSchemaConfigFlowHandler, domain="test"): class TestFlow(MockSchemaConfigFlowHandler, domain="test"):
config_flow = {} config_flow = {}
options_flow = OPTIONS_FLOW options_flow = OPTIONS_FLOW
@ -326,7 +326,7 @@ async def test_menu_step(hass: HomeAssistant) -> None:
"option4": SchemaFlowFormStep(vol.Schema({})), "option4": SchemaFlowFormStep(vol.Schema({})),
} }
class TestConfigFlow(TestSchemaConfigFlowHandler, domain=TEST_DOMAIN): class TestConfigFlow(MockSchemaConfigFlowHandler, domain=TEST_DOMAIN):
"""Handle a config or options flow for Derivative.""" """Handle a config or options flow for Derivative."""
config_flow = CONFIG_FLOW config_flow = CONFIG_FLOW
@ -375,7 +375,7 @@ async def test_schema_none(hass: HomeAssistant) -> None:
"option3": SchemaFlowFormStep(vol.Schema({})), "option3": SchemaFlowFormStep(vol.Schema({})),
} }
class TestConfigFlow(TestSchemaConfigFlowHandler, domain=TEST_DOMAIN): class TestConfigFlow(MockSchemaConfigFlowHandler, domain=TEST_DOMAIN):
"""Handle a config or options flow for Derivative.""" """Handle a config or options flow for Derivative."""
config_flow = CONFIG_FLOW config_flow = CONFIG_FLOW
@ -409,7 +409,7 @@ async def test_last_step(hass: HomeAssistant) -> None:
"step3": SchemaFlowFormStep(vol.Schema({}), next_step=None), "step3": SchemaFlowFormStep(vol.Schema({}), next_step=None),
} }
class TestConfigFlow(TestSchemaConfigFlowHandler, domain=TEST_DOMAIN): class TestConfigFlow(MockSchemaConfigFlowHandler, domain=TEST_DOMAIN):
"""Handle a config or options flow for Derivative.""" """Handle a config or options flow for Derivative."""
config_flow = CONFIG_FLOW config_flow = CONFIG_FLOW
@ -452,7 +452,7 @@ async def test_next_step_function(hass: HomeAssistant) -> None:
"step2": SchemaFlowFormStep(vol.Schema({}), next_step=_step2_next_step), "step2": SchemaFlowFormStep(vol.Schema({}), next_step=_step2_next_step),
} }
class TestConfigFlow(TestSchemaConfigFlowHandler, domain=TEST_DOMAIN): class TestConfigFlow(MockSchemaConfigFlowHandler, domain=TEST_DOMAIN):
"""Handle a config or options flow for Derivative.""" """Handle a config or options flow for Derivative."""
config_flow = CONFIG_FLOW config_flow = CONFIG_FLOW
@ -509,7 +509,7 @@ async def test_suggested_values(
), ),
} }
class TestFlow(TestSchemaConfigFlowHandler, domain="test"): class TestFlow(MockSchemaConfigFlowHandler, domain="test"):
config_flow = {} config_flow = {}
options_flow = OPTIONS_FLOW options_flow = OPTIONS_FLOW
@ -620,7 +620,7 @@ async def test_options_flow_state(hass: HomeAssistant) -> None:
), ),
} }
class TestFlow(TestSchemaConfigFlowHandler, domain="test"): class TestFlow(MockSchemaConfigFlowHandler, domain="test"):
config_flow = {} config_flow = {}
options_flow = OPTIONS_FLOW options_flow = OPTIONS_FLOW

View File

@ -266,7 +266,7 @@ class AiohttpClientMockResponse:
raise ClientResponseError( raise ClientResponseError(
request_info=request_info, request_info=request_info,
history=None, history=None,
code=self.status, status=self.status,
headers=self.headers, headers=self.headers,
) )