From 3adcfbcdaa70a514734186c6780ed6ba3a5c7704 Mon Sep 17 00:00:00 2001 From: Ronnie Dutta <61982285+MetRonnie@users.noreply.github.com> Date: Tue, 31 Oct 2023 10:05:22 +0000 Subject: [PATCH] Exclude broken pytest-asyncio version; remove pytest-mock --- setup.cfg | 4 ++-- tests/unit/test_id_cli.py | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/setup.cfg b/setup.cfg index 2229d24a007..4f60fcd1e9f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -115,11 +115,11 @@ tests = flake8-simplify>=0.14.0 flake8>=3.0.0 mypy>=0.910 - pytest-asyncio>=0.17 + # https://github.com/pytest-dev/pytest-asyncio/issues/655 + pytest-asyncio>=0.17,!=0.22.0 pytest-cov>=2.8.0 pytest-xdist>=2 pytest-env>=0.6.2 - pytest-mock>=3.6.1 pytest>=6 testfixtures>=6.11.0 towncrier>=23 diff --git a/tests/unit/test_id_cli.py b/tests/unit/test_id_cli.py index 4f1099b164b..7649e9fa0f2 100644 --- a/tests/unit/test_id_cli.py +++ b/tests/unit/test_id_cli.py @@ -35,9 +35,8 @@ @pytest.fixture -def mock_exists(mocker): - mock_exists = mocker.patch('pathlib.Path.exists') - mock_exists.return_value = True +def mock_exists(monkeypatch: pytest.MonkeyPatch): + monkeypatch.setattr('pathlib.Path.exists', lambda *a, **k: True) @pytest.fixture(scope='module')