Skip to content

Commit

Permalink
Update link to notes about usage as context manager (#313)
Browse files Browse the repository at this point in the history
Fix #312
  • Loading branch information
nicoddemus committed Sep 9, 2022
1 parent 903b972 commit 0fd7fea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
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

0 comments on commit 0fd7fea

Please sign in to comment.