From 17ceb52abd690fda214dbd94333582fd6bb696e9 Mon Sep 17 00:00:00 2001 From: Sergey Vasilyev Date: Sat, 5 Oct 2019 11:10:16 +0200 Subject: [PATCH] Fix the tests for the new pytest-mock package structure --- requirements.txt | 2 +- tests/conftest.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 33bd05ca..517015da 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,7 +6,7 @@ urllib3<1.25 # Everything needed to develop (test, debug) the framework. pytest-asyncio -pytest-mock +pytest-mock>=1.11.1 pytest-cov pytest asynctest diff --git a/tests/conftest.py b/tests/conftest.py index de5c2d84..036eaa89 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -66,7 +66,8 @@ def _is_e2e(item): # Substitute the regular mock with the async-aware mock in the `mocker` fixture. @pytest.fixture(scope='session', autouse=True) def enforce_asyncio_mocker(): - pytest_mock._get_mock_module = lambda config: asynctest + pytest_mock.plugin._get_mock_module = lambda config: asynctest + pytest_mock._get_mock_module = pytest_mock.plugin._get_mock_module @pytest.fixture()