diff --git a/requirements_tests.txt b/requirements_tests.txt index 562426b09..c40bccfa7 100644 --- a/requirements_tests.txt +++ b/requirements_tests.txt @@ -2,10 +2,10 @@ coverage==7.4.3 pre-commit==3.6.2 pylint==3.1.0 pytest-aiohttp==1.0.5 -pytest-asyncio==0.23.3 +pytest-asyncio==0.23.5 pytest-cov==4.1.0 pytest-timeout==2.2.0 -pytest==7.4.4 +pytest==8.0.1 ruff==0.2.2 time-machine==2.13.0 typing_extensions==4.10.0 diff --git a/tests/test_supervisor.py b/tests/test_supervisor.py index 2da48effe..7fa03bf14 100644 --- a/tests/test_supervisor.py +++ b/tests/test_supervisor.py @@ -1,6 +1,6 @@ """Test supervisor object.""" -from datetime import timedelta +from datetime import datetime import errno from unittest.mock import AsyncMock, Mock, PropertyMock, patch @@ -23,7 +23,7 @@ from supervisor.resolution.data import Issue from supervisor.supervisor import Supervisor -@pytest.fixture(name="websession") +@pytest.fixture(name="websession", scope="function") async def fixture_webession(coresys: CoreSys) -> AsyncMock: """Mock of websession.""" mock_websession = AsyncMock() @@ -36,10 +36,7 @@ async def fixture_webession(coresys: CoreSys) -> AsyncMock: @pytest.fixture(name="supervisor_unthrottled") async def fixture_supervisor_unthrottled(coresys: CoreSys) -> Supervisor: """Get supervisor object with connectivity check throttle removed.""" - with patch( - "supervisor.supervisor._check_connectivity_throttle_period", - return_value=timedelta(), - ): + with patch("supervisor.jobs.decorator.Job.last_call", return_value=datetime.min): yield coresys.supervisor