Skip to content

Commit f20dfc6

Browse files
update tests
1 parent 2877f7b commit f20dfc6

1 file changed

Lines changed: 19 additions & 11 deletions

File tree

tests/integrations/sqlalchemy/test_sqlalchemy.py

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -485,8 +485,9 @@ class Person(Base):
485485
attributes = span["attributes"]
486486

487487
assert SPANDATA.CODE_LINE_NUMBER not in attributes
488+
assert SPANDATA.CODE_NAMESPACE not in attributes
488489
assert SPANDATA.CODE_FILE_PATH not in attributes
489-
assert SPANDATA.CODE_FUNCTION_NAME not in attributes
490+
assert SPANDATA.CODE_FUNCTION not in attributes
490491
break
491492
else:
492493
raise AssertionError("No db span found")
@@ -586,8 +587,9 @@ class Person(Base):
586587
attributes = span["attributes"]
587588

588589
assert SPANDATA.CODE_LINE_NUMBER in attributes
590+
assert SPANDATA.CODE_NAMESPACE in attributes
589591
assert SPANDATA.CODE_FILE_PATH in attributes
590-
assert SPANDATA.CODE_FUNCTION_NAME in attributes
592+
assert SPANDATA.CODE_FUNCTION in attributes
591593
break
592594
else:
593595
raise AssertionError("No db span found")
@@ -679,21 +681,24 @@ class Person(Base):
679681
attributes = span["attributes"]
680682

681683
assert SPANDATA.CODE_LINE_NUMBER in attributes
684+
assert SPANDATA.CODE_NAMESPACE in attributes
682685
assert SPANDATA.CODE_FILE_PATH in attributes
683-
assert SPANDATA.CODE_FUNCTION_NAME in attributes
686+
assert SPANDATA.CODE_FUNCTION in attributes
684687

685688
assert type(attributes.get(SPANDATA.CODE_LINE_NUMBER)) == int
686689
assert attributes.get(SPANDATA.CODE_LINE_NUMBER) > 0
690+
assert (
691+
attributes.get(SPANDATA.CODE_NAMESPACE)
692+
== "tests.integrations.sqlalchemy.test_sqlalchemy"
693+
)
687694
assert attributes.get(SPANDATA.CODE_FILE_PATH).endswith(
688695
"tests/integrations/sqlalchemy/test_sqlalchemy.py"
689696
)
690697

691698
is_relative_path = attributes.get(SPANDATA.CODE_FILE_PATH)[0] != os.sep
692699
assert is_relative_path
693700

694-
assert (
695-
attributes.get(SPANDATA.CODE_FUNCTION_NAME) == "test_query_source"
696-
)
701+
assert attributes.get(SPANDATA.CODE_FUNCTION) == "test_query_source"
697702
break
698703
else:
699704
raise AssertionError("No db span found")
@@ -809,8 +814,9 @@ class Person(Base):
809814
attributes = span["attributes"]
810815

811816
assert SPANDATA.CODE_LINE_NUMBER in attributes
817+
assert SPANDATA.CODE_NAMESPACE in attributes
812818
assert SPANDATA.CODE_FILE_PATH in attributes
813-
assert SPANDATA.CODE_FUNCTION_NAME in attributes
819+
assert SPANDATA.CODE_FUNCTION in attributes
814820

815821
assert type(attributes.get(SPANDATA.CODE_LINE_NUMBER)) == int
816822
assert attributes.get(SPANDATA.CODE_LINE_NUMBER) > 0
@@ -823,7 +829,7 @@ class Person(Base):
823829
assert is_relative_path
824830

825831
assert (
826-
attributes.get(SPANDATA.CODE_FUNCTION_NAME)
832+
attributes.get(SPANDATA.CODE_FUNCTION)
827833
== "query_first_model_from_session"
828834
)
829835
break
@@ -955,8 +961,9 @@ def __exit__(self, type, value, traceback):
955961
attributes = span["attributes"]
956962

957963
assert SPANDATA.CODE_LINE_NUMBER not in attributes
964+
assert SPANDATA.CODE_NAMESPACE not in attributes
958965
assert SPANDATA.CODE_FILE_PATH not in attributes
959-
assert SPANDATA.CODE_FUNCTION_NAME not in attributes
966+
assert SPANDATA.CODE_FUNCTION not in attributes
960967
break
961968
else:
962969
raise AssertionError("No db span found")
@@ -1094,8 +1101,9 @@ def __exit__(self, type, value, traceback):
10941101
attributes = span["attributes"]
10951102

10961103
assert SPANDATA.CODE_LINE_NUMBER in attributes
1104+
assert SPANDATA.CODE_NAMESPACE in attributes
10971105
assert SPANDATA.CODE_FILE_PATH in attributes
1098-
assert SPANDATA.CODE_FUNCTION_NAME in attributes
1106+
assert SPANDATA.CODE_FUNCTION in attributes
10991107

11001108
assert type(attributes.get(SPANDATA.CODE_LINE_NUMBER)) == int
11011109
assert attributes.get(SPANDATA.CODE_LINE_NUMBER) > 0
@@ -1107,7 +1115,7 @@ def __exit__(self, type, value, traceback):
11071115
assert is_relative_path
11081116

11091117
assert (
1110-
attributes.get(SPANDATA.CODE_FUNCTION_NAME)
1118+
attributes.get(SPANDATA.CODE_FUNCTION)
11111119
== "test_query_source_if_duration_over_threshold"
11121120
)
11131121
break

0 commit comments

Comments
 (0)