diff --git a/testing/deprecated_test.py b/testing/deprecated_test.py index 0974cf6c6..027a773b8 100644 --- a/testing/deprecated_test.py +++ b/testing/deprecated_test.py @@ -183,7 +183,10 @@ def test_hookproxy_warnings_for_fspath(tmp_path, hooktype, request): def test_warns_none_is_deprecated(): with pytest.warns( PytestDeprecationWarning, - match=r"Passing None to catch any warning has been deprecated, pass no arguments instead:\n Replace pytest.warns\(None\) by simply pytest.warns\(\).", + match=re.escape( + "Passing None to catch any warning has been deprecated, pass no arguments instead:\n " + "Replace pytest.warns(None) by simply pytest.warns()." + ), ): with pytest.warns(None): pass