Skip to content

Commit 830eda4

Browse files
committed
fix: Do not assume sentry.release is set
1 parent e964133 commit 830eda4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tests/test_logs.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,8 @@ def test_logs_attributes(sentry_init, capture_envelopes):
230230
for k, v in attrs.items():
231231
assert logs[0]["attributes"][k] == v
232232
assert logs[0]["attributes"]["sentry.environment"] == "production"
233+
if sentry_sdk.get_client().options.get("release") is not None:
234+
assert "sentry.release" in logs[0]["attributes"]
233235
assert logs[0]["attributes"]["sentry.message.parameter.my_var"] == "some value"
234236
assert logs[0]["attributes"][SPANDATA.SERVER_ADDRESS] == "test-server"
235237
assert logs[0]["attributes"]["sentry.sdk.name"].startswith("sentry.python")

0 commit comments

Comments
 (0)