Skip to content

Commit 279d16f

Browse files
In tests, error on deprecation warnings about python_multipart from starlette integrations
1 parent d48dc46 commit 279d16f

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

tests/integrations/starlette/test_starlette.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,16 @@
1313

1414
from sentry_sdk import capture_message, get_baggage, get_traceparent
1515
from sentry_sdk.integrations.asgi import SentryAsgiMiddleware
16-
from sentry_sdk.integrations.starlette import (
17-
StarletteIntegration,
18-
StarletteRequestExtractor,
19-
)
16+
with warnings.catch_warnings():
17+
# Error on deprecation-type warnings related to python_multipart, which are
18+
# probably about migrating from "import multipart" to "import
19+
# python_multipart".
20+
for w in (PendingDeprecationWarning, DeprecationWarning):
21+
warnings.filterwarnings("error", ".*python_multipart.*", category=w)
22+
from sentry_sdk.integrations.starlette import (
23+
StarletteIntegration,
24+
StarletteRequestExtractor,
25+
)
2026
from sentry_sdk.utils import parse_version
2127

2228
import starlette

0 commit comments

Comments
 (0)