Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update link to notes about usage as context manager #313

Merged
merged 2 commits into from Sep 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/pytest_mock/plugin.py
Expand Up @@ -213,7 +213,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://github.com/pytest-dev/pytest-mock#note-about-usage-as-context-manager",
"https://pytest-mock.readthedocs.io/en/latest/remarks.html#usage-as-context-manager",
PytestMockWarning,
stacklevel=depth,
)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_pytest_mock.py
Expand Up @@ -884,7 +884,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://github.com/pytest-dev/pytest-mock#note-about-usage-as-context-manager"
"https://pytest-mock.readthedocs.io/en/latest/remarks.html#usage-as-context-manager"
)

with pytest.warns(
Expand All @@ -901,7 +901,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://github.com/pytest-dev/pytest-mock#note-about-usage-as-context-manager"
"https://pytest-mock.readthedocs.io/en/latest/remarks.html#usage-as-context-manager"
)

with pytest.warns(
Expand Down