From 200ca5691fd7460383c088f32ef591626bbd69cf Mon Sep 17 00:00:00 2001 From: Roman Inflianskas Date: Thu, 17 Apr 2025 19:24:39 +0300 Subject: [PATCH] test(logs): Avoid failure when running with integrations enabled 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. --- tests/test_logs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_logs.py b/tests/test_logs.py index 1c34d52b20..5ede277e3b 100644 --- a/tests/test_logs.py +++ b/tests/test_logs.py @@ -186,7 +186,7 @@ def test_logs_attributes(sentry_init, capture_envelopes): assert "sentry.release" in logs[0]["attributes"] assert logs[0]["attributes"]["sentry.message.parameters.my_var"] == "some value" assert logs[0]["attributes"][SPANDATA.SERVER_ADDRESS] == "test-server" - assert logs[0]["attributes"]["sentry.sdk.name"] == "sentry.python" + assert logs[0]["attributes"]["sentry.sdk.name"].startswith("sentry.python") assert logs[0]["attributes"]["sentry.sdk.version"] == VERSION