From ac96256272b6b806f1b036ed4476910b16dd7ff0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Robert?= Date: Thu, 4 Jan 2024 11:51:12 +0100 Subject: [PATCH] Fix a mistake in pytest.warns' docstring (expect_warning accepts tuples, not any sequence) --- src/_pytest/recwarn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/recwarn.py b/src/_pytest/recwarn.py index 175d545b9..b3279dd31 100644 --- a/src/_pytest/recwarn.py +++ b/src/_pytest/recwarn.py @@ -113,7 +113,7 @@ def warns( # noqa: F811 ) -> Union["WarningsChecker", Any]: r"""Assert that code raises a particular class of warning. - Specifically, the parameter ``expected_warning`` can be a warning class or sequence + Specifically, the parameter ``expected_warning`` can be a warning class or tuple of warning classes, and the code inside the ``with`` block must issue at least one warning of that class or classes.