Add better warning msg for deprecated warns(None)

This commit is contained in:
Olga Matoula
2021-05-16 12:07:39 +01:00
parent 6ae71a2c2b
commit dbe66d97b4
3 changed files with 6 additions and 3 deletions

View File

@@ -103,7 +103,8 @@ HOOK_LEGACY_PATH_ARG = UnformattedWarning(
)
WARNS_NONE_ARG = PytestDeprecationWarning(
"Please pass an explicit Warning type or tuple of Warning types."
"Passing None to catch any warning has been deprecated, pass no arguments instead:\n"
" Replace pytest.warns(None) by simply pytest.warns()."
)
# You want to make some `__init__` or function "private".