Skip to content

Commit 8480bb6

Browse files
authored
Fix tests for Python 3.11 and 3.12
Fixes #401.
1 parent 7f9c131 commit 8480bb6

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

tests/test_pytest_mock.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,8 @@ def __test_failure_message(self, mocker: MockerFixture, **kwargs: Any) -> None:
246246
msg = "Expected call: {0}()\nNot called"
247247
expected_message = msg.format(expected_name)
248248
stub = mocker.stub(**kwargs)
249-
with pytest.raises(AssertionError) as exc_info:
249+
with pytest.raises(AssertionError, match=re.escape(expected_message)) as exc_info:
250250
stub.assert_called_with()
251-
assert str(exc_info.value) == expected_message
252251

253252
def test_failure_message_with_no_name(self, mocker: MagicMock) -> None:
254253
self.__test_failure_message(mocker)

0 commit comments

Comments
 (0)