diff --git a/src/pytest_mock/plugin.py b/src/pytest_mock/plugin.py index 1d9192c..50dc06a 100644 --- a/src/pytest_mock/plugin.py +++ b/src/pytest_mock/plugin.py @@ -264,7 +264,7 @@ def _start_patch( "Mocks returned by pytest-mock do not need to be used as context managers. " "The mocker fixture automatically undoes mocking at the end of a test. " "This warning can be ignored if it was triggered by mocking a context manager. " - "https://pytest-mock.readthedocs.io/en/latest/remarks.html#usage-as-context-manager", + "https://pytest-mock.readthedocs.io/en/latest/usage.html#usage-as-context-manager", PytestMockWarning, stacklevel=5, ) diff --git a/tests/test_pytest_mock.py b/tests/test_pytest_mock.py index cbfc558..1a51636 100644 --- a/tests/test_pytest_mock.py +++ b/tests/test_pytest_mock.py @@ -997,7 +997,7 @@ def doIt(self): "Mocks returned by pytest-mock do not need to be used as context managers. " "The mocker fixture automatically undoes mocking at the end of a test. " "This warning can be ignored if it was triggered by mocking a context manager. " - "https://pytest-mock.readthedocs.io/en/latest/remarks.html#usage-as-context-manager" + "https://pytest-mock.readthedocs.io/en/latest/usage.html#usage-as-context-manager" ) with pytest.warns( @@ -1014,7 +1014,7 @@ def test_warn_patch_context_manager(mocker: MockerFixture) -> None: "Mocks returned by pytest-mock do not need to be used as context managers. " "The mocker fixture automatically undoes mocking at the end of a test. " "This warning can be ignored if it was triggered by mocking a context manager. " - "https://pytest-mock.readthedocs.io/en/latest/remarks.html#usage-as-context-manager" + "https://pytest-mock.readthedocs.io/en/latest/usage.html#usage-as-context-manager" ) with pytest.warns(