From d493ccde2888c3130b811c749ba2b5804e103d7e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 27 Feb 2024 09:57:44 +0100 Subject: [PATCH] Bump pytest from 7.4.4 to 8.0.1 (#4901) * Bump pytest from 7.4.4 to 8.0.1 Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.4.4 to 8.0.1. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/7.4.4...8.0.1) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * Update pytest-asyncio to 0.23.5 * Set scope to function on fixture * Unthrottle by patching last call to prevent carryover --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Stefan Agner Co-authored-by: Mike Degatano --- requirements_tests.txt | 4 ++-- tests/test_supervisor.py | 9 +++------ 2 files changed, 5 insertions(+), 8 deletions(-) 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