diff --git a/pytest_mock.py b/pytest_mock.py index 492a5ff..23dc08b 100644 --- a/pytest_mock.py +++ b/pytest_mock.py @@ -78,13 +78,12 @@ def mocker(): result.stopall() -@pytest.yield_fixture -def mock(): +@pytest.fixture +def mock(mocker): """ Same as "mocker", but kept only for backward compatibility. """ import warnings warnings.warn('"mock" fixture has been deprecated, use "mocker" instead', DeprecationWarning) - for m in mocker(): - yield m \ No newline at end of file + return mocker