Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions tests/integrations/pymongo/test_pymongo.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import re

from sentry_sdk import capture_message, start_transaction
import sentry_sdk
from sentry_sdk.consts import SPANDATA
from sentry_sdk.integrations.pymongo import PyMongoIntegration, _strip_pii

Expand Down Expand Up @@ -37,7 +37,7 @@ def test_transactions(sentry_init, capture_events, mongo_server, with_pii):

connection = MongoClient(mongo_server.uri)

with start_transaction():
with sentry_sdk.start_span():
list(
connection["test_db"]["test_collection"].find({"foobar": 1})
) # force query execution
Expand Down Expand Up @@ -119,13 +119,9 @@ def test_breadcrumbs(
list(
connection["test_db"]["test_collection"].find({"foobar": 1})
) # force query execution
capture_message("hi")

if traces_sample_rate:
event = events[1]
else:
event = events[0]
sentry_sdk.capture_message("hi")

(event,) = events
(crumb,) = event["breadcrumbs"]["values"]

assert crumb["category"] == "query"
Expand Down Expand Up @@ -450,7 +446,7 @@ def test_span_origin(sentry_init, capture_events, mongo_server):

connection = MongoClient(mongo_server.uri)

with start_transaction():
with sentry_sdk.start_span():
list(
connection["test_db"]["test_collection"].find({"foobar": 1})
) # force query execution
Expand Down
Loading