Skip to content

Commit a7112ba

Browse files
fix quart tests
1 parent 539b1cd commit a7112ba

1 file changed

Lines changed: 27 additions & 3 deletions

File tree

tests/integrations/quart/test_quart.py

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
set_tag,
1515
)
1616
from sentry_sdk.integrations.logging import LoggingIntegration
17-
from sentry_sdk.utils import SENSITIVE_DATA_SUBSTITUTE
17+
from sentry_sdk.utils import SENSITIVE_DATA_SUBSTITUTE, package_version
18+
19+
QUART_VERSION = package_version("quart")
1820

1921

2022
def quart_app_factory():
@@ -696,7 +698,18 @@ async def test_request_url(sentry_init, capture_events):
696698
client = app.test_client()
697699

698700
events = capture_events()
699-
await client.get("/root/nomessage", root_path="/root")
701+
702+
# https://github.com/pallets/quart/commit/7be545c
703+
url = (
704+
"/root/nomessage"
705+
if QUART_VERSION
706+
>= (
707+
0,
708+
19,
709+
)
710+
else "/nomessage"
711+
)
712+
await client.get(url, root_path="/root")
700713

701714
(event,) = events
702715
assert event["request"]["url"] == "http://localhost/root/nomessage"
@@ -1002,7 +1015,18 @@ async def test_span_streaming_request_url(sentry_init, capture_items):
10021015
client = app.test_client()
10031016

10041017
items = capture_items("span")
1005-
await client.get("/root/nomessage", root_path="/root")
1018+
1019+
# https://github.com/pallets/quart/commit/7be545c
1020+
url = (
1021+
"/root/nomessage"
1022+
if QUART_VERSION
1023+
>= (
1024+
0,
1025+
19,
1026+
)
1027+
else "/nomessage"
1028+
)
1029+
await client.get(url, root_path="/root")
10061030

10071031
sentry_sdk.flush()
10081032
spans = [item.payload for item in items]

0 commit comments

Comments
 (0)