diff --git a/tests/_internals/capture_warnings.py b/tests/_internals/capture_warnings.py index 9380fdfe5ae8a..d16b8f66ed33d 100644 --- a/tests/_internals/capture_warnings.py +++ b/tests/_internals/capture_warnings.py @@ -127,8 +127,8 @@ def __init__(self, config: pytest.Config, output_path: str | None = None): def pytest_runtest_call(self, item: pytest.Item): with warnings.catch_warnings(record=True) as records: if not sys.warnoptions: - warnings.filterwarnings("always", category=DeprecationWarning) - warnings.filterwarnings("always", category=PendingDeprecationWarning) + warnings.filterwarnings("always", category=DeprecationWarning, append=True) + warnings.filterwarnings("always", category=PendingDeprecationWarning, append=True) yield for record in records: