diff --git a/requirements_test.txt b/requirements_test.txt index c0c0c9d9878..9b4590b613c 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -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 diff --git a/tests/components/dyson/test_climate.py b/tests/components/dyson/test_climate.py index 296812bb0cf..124fc46f325 100644 --- a/tests/components/dyson/test_climate.py +++ b/tests/components/dyson/test_climate.py @@ -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 "" + def _get_config(): """Return a config dictionary.""" diff --git a/tests/components/dyson/test_fan.py b/tests/components/dyson/test_fan.py index 807cf3565ed..11770e1f133 100644 --- a/tests/components/dyson/test_fan.py +++ b/tests/components/dyson/test_fan.py @@ -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 "" + def _get_dyson_purecool_device(): """Return a valid device as provided by the Dyson web services.""" diff --git a/tests/components/pvpc_hourly_pricing/test_sensor.py b/tests/components/pvpc_hourly_pricing/test_sensor.py index 57861b8b72b..6dae784a0cc 100644 --- a/tests/components/pvpc_hourly_pricing/test_sensor.py +++ b/tests/components/pvpc_hourly_pricing/test_sensor.py @@ -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 diff --git a/tests/mock/zwave.py b/tests/mock/zwave.py index 1049108f9de..41c0aa5727b 100644 --- a/tests/mock/zwave.py +++ b/tests/mock/zwave.py @@ -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",