diff --git a/tests/__init__.py b/tests/__init__.py index cac15f9333..2e4df719d5 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,6 +1,5 @@ import sys - -import pytest +import warnings # This is used in _capture_internal_warnings. We need to run this at import # time because that's where many deprecation warnings might get thrown. @@ -9,5 +8,5 @@ # gets loaded too late. assert "sentry_sdk" not in sys.modules -_warning_recorder_mgr = pytest.warns(None) +_warning_recorder_mgr = warnings.catch_warnings(record=True) _warning_recorder = _warning_recorder_mgr.__enter__()