def test_no_resource_warning_with_context_manager():
> with pytest.warns(None) as record: # ensure no warnings are raised
tests/test_rest.py:1175:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = WarningsChecker(record=True), expected_warning = None, match_expr = None
def __init__(
self,
expected_warning: Optional[
Union[Type[Warning], Tuple[Type[Warning], ...]]
] = Warning,
match_expr: Optional[Union[str, Pattern[str]]] = None,
*,
_ispytest: bool = False,
) -> None:
check_ispytest(_ispytest)
super().__init__(_ispytest=True)
msg = "exceptions must be derived from Warning, not %s"
if expected_warning is None:
> warnings.warn(WARNS_NONE_ARG, stacklevel=4)
E pytest.PytestRemovedIn8Warning: Passing None has been deprecated.
E See https://docs.pytest.org/en/latest/how-to/capture-warnings.html#additional-use-cases-of-warnings-in-tests for alternatives in common use cases.
.eggs/pytest-8.0.0rc1-py3.10.egg/_pytest/recwarn.py:279: PytestRemovedIn8Warning
FAILED tests/test_rest.py::test_no_resource_warning_with_context_manager - pytest.PytestRemovedIn8Warning: Passing None has been deprecated.
See https://docs.pytest.org/en/latest/how-to/capture-warnings.html#additional-use-cases-of-warnings-in-tests for alternatives in common use cases.