diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py index 955fb4165..9257d210c 100644 --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -497,7 +497,7 @@ def _is_numpy_array(obj): def raises(expected_exception, *args, **kwargs): - """ + r""" Assert that a code block/function call raises ``expected_exception`` and raise a failure exception otherwise. diff --git a/src/_pytest/recwarn.py b/src/_pytest/recwarn.py index 565af8a3f..7839f5700 100644 --- a/src/_pytest/recwarn.py +++ b/src/_pytest/recwarn.py @@ -85,7 +85,7 @@ class _DeprecatedCallContext(object): def warns(expected_warning, *args, **kwargs): - """Assert that code raises a particular class of warning. + r"""Assert that code raises a particular class of warning. Specifically, the parameter ``expected_warning`` can be a warning class or sequence of warning classes, and the inside the ``with`` block must issue a warning of that class or