Skip to content

Commit f128c0e

Browse files
committed
fixed Python 2.7 error.
1 parent 31b880c commit f128c0e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/integrations/bottle/test_bottle.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def test_has_context(sentry_init, app, capture_events, get_client):
6262
@pytest.mark.parametrize(
6363
"url,transaction_style,expected_transaction,expected_source",
6464
[
65-
("/message", "endpoint", "test_bottle.app.<locals>.hi", "component"),
65+
("/message", "endpoint", "hi", "component"),
6666
("/message", "url", "/message", "route"),
6767
("/message/123456", "url", "/message/<message_id>", "route"),
6868
("/message-named-route", "endpoint", "hi", "component"),
@@ -89,7 +89,9 @@ def test_transaction_style(
8989
assert response[1] == "200 OK"
9090

9191
(event,) = events
92-
assert event["transaction"] == expected_transaction
92+
# We use endswith() because in Python 2.7 it is "test_bottle.hi"
93+
# and in later Pythons "test_bottle.app.<locals>.hi"
94+
assert event["transaction"].endswith(".{}".format(expected_transaction))
9395
assert event["transaction_info"] == {"source": expected_source}
9496

9597

0 commit comments

Comments
 (0)