From 0be3b1b1b249127fb094da7b73a744f7002b9c12 Mon Sep 17 00:00:00 2001 From: Anton Pirker Date: Fri, 28 Jul 2023 11:45:15 +0200 Subject: [PATCH] fix tests --- sentry_sdk/integrations/pymongo.py | 2 +- tests/integrations/sqlalchemy/test_sqlalchemy.py | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/sentry_sdk/integrations/pymongo.py b/sentry_sdk/integrations/pymongo.py index d64f4c8223..59001bb937 100644 --- a/sentry_sdk/integrations/pymongo.py +++ b/sentry_sdk/integrations/pymongo.py @@ -86,7 +86,7 @@ def _strip_pii(command): def _get_db_data(event): - # type: (Union[CommandFailedEvent, CommandStartedEvent, CommandSucceededEvent]) -> Dict[str, Any] + # type: (Any) -> Dict[str, Any] data = {} data[SPANDATA.DB_SYSTEM] = "mongodb" diff --git a/tests/integrations/sqlalchemy/test_sqlalchemy.py b/tests/integrations/sqlalchemy/test_sqlalchemy.py index ba26c088f5..eb1792b3be 100644 --- a/tests/integrations/sqlalchemy/test_sqlalchemy.py +++ b/tests/integrations/sqlalchemy/test_sqlalchemy.py @@ -123,12 +123,8 @@ class Address(Base): for span in event["spans"]: assert span["data"][SPANDATA.DB_SYSTEM] == "sqlite" assert span["data"][SPANDATA.DB_NAME] == ":memory:" - assert ( - span["data"][SPANDATA.SERVER_ADDRESS] is None - ) # sqlite does not have a server - assert ( - span["data"][SPANDATA.SERVER_PORT] is None - ) # sqlite does not have a server + assert SPANDATA.SERVER_ADDRESS not in span["data"] + assert SPANDATA.SERVER_PORT not in span["data"] assert ( render_span_tree(event)