mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 20:27:08 +00:00
Upgrade pytest to 6.0.2 (#39959)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
This commit is contained in:
parent
8236394b85
commit
5d0fa1417e
@ -21,7 +21,7 @@ pytest-test-groups==1.0.3
|
||||
pytest-sugar==0.9.4
|
||||
pytest-timeout==1.4.2
|
||||
pytest-xdist==1.32.0
|
||||
pytest==5.4.3
|
||||
pytest==6.0.2
|
||||
requests_mock==1.8.0
|
||||
responses==0.12.0
|
||||
stdlib-list==0.7.0
|
||||
|
@ -56,6 +56,10 @@ class MockDysonState(DysonPureHotCoolState):
|
||||
def __init__(self):
|
||||
"""Create new Mock Dyson State."""
|
||||
|
||||
def __repr__(self):
|
||||
"""Mock repr because original one fails since constructor not called."""
|
||||
return "<MockDysonState>"
|
||||
|
||||
|
||||
def _get_config():
|
||||
"""Return a config dictionary."""
|
||||
|
@ -38,6 +38,10 @@ class MockDysonState(DysonPureCoolState):
|
||||
"""Create new Mock Dyson State."""
|
||||
pass
|
||||
|
||||
def __repr__(self):
|
||||
"""Mock repr because original one fails since constructor not called."""
|
||||
return "<MockDysonState>"
|
||||
|
||||
|
||||
def _get_dyson_purecool_device():
|
||||
"""Return a valid device as provided by the Dyson web services."""
|
||||
|
@ -54,12 +54,8 @@ async def test_sensor_availability(
|
||||
# sensor has no more prices, state is "unavailable" from now on
|
||||
await _process_time_step(hass, mock_data, value="unavailable")
|
||||
await _process_time_step(hass, mock_data, value="unavailable")
|
||||
num_errors = sum(
|
||||
1 for x in caplog.get_records("call") if x.levelno == logging.ERROR
|
||||
)
|
||||
num_warnings = sum(
|
||||
1 for x in caplog.get_records("call") if x.levelno == logging.WARNING
|
||||
)
|
||||
num_errors = sum(1 for x in caplog.records if x.levelno == logging.ERROR)
|
||||
num_warnings = sum(1 for x in caplog.records if x.levelno == logging.WARNING)
|
||||
assert num_warnings == 1
|
||||
assert num_errors == 0
|
||||
assert pvpc_aioclient_mock.call_count == 9
|
||||
|
@ -106,7 +106,7 @@ class MockNode(MagicMock):
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
node_id="567",
|
||||
node_id=567,
|
||||
name="Mock Node",
|
||||
manufacturer_id="ABCD",
|
||||
product_id="123",
|
||||
|
Loading…
x
Reference in New Issue
Block a user