From dd8ad3fa9c9862037e244f8460d0e726f7678779 Mon Sep 17 00:00:00 2001 From: Olga Matoula Date: Mon, 17 May 2021 09:23:08 +0100 Subject: [PATCH] Split warns matching string in multiple lines --- testing/deprecated_test.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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