Skip to content

Commit c361337

Browse files
authored
test(logs): Avoid failure when running with integrations enabled (#4316)
When (at least) one of integrations is enabled (because some dependencies are installed in the environment), `sentry.sdk.name` is changed from `sentry.python` to `sentry.python.[FIRST_ENABLED_INTEGRATION]` which makes `test_logs_attributes` fail. Prevent failure by relaxing the check. This change is beneficial not only for packaging (this patch was required for packaging for Fedora), but also for running tests with `pytest` directly. <!-- Describe your PR here --> --- Thank you for contributing to `sentry-python`! Please add tests to validate your changes, and lint your code using `tox -e linters`. Running the test suite on your PR might require maintainer approval.
1 parent f3687fc commit c361337

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/test_logs.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def test_logs_attributes(sentry_init, capture_envelopes):
186186
assert "sentry.release" in logs[0]["attributes"]
187187
assert logs[0]["attributes"]["sentry.message.parameters.my_var"] == "some value"
188188
assert logs[0]["attributes"][SPANDATA.SERVER_ADDRESS] == "test-server"
189-
assert logs[0]["attributes"]["sentry.sdk.name"] == "sentry.python"
189+
assert logs[0]["attributes"]["sentry.sdk.name"].startswith("sentry.python")
190190
assert logs[0]["attributes"]["sentry.sdk.version"] == VERSION
191191

192192

0 commit comments

Comments
 (0)