Skip to content

Commit ef40ca6

Browse files
committed
Assert attribute deletion was successful.
1 parent 7160696 commit ef40ca6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/agent_features/test_llm_custom_attributes.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ def test_llm_custom_attributes():
2525
with WithLlmCustomAttributes({"test": "attr", "test1": "attr1"}):
2626
assert transaction._llm_context_attrs == {"llm.test": "attr", "llm.test1": "attr1"}
2727

28+
assert not hasattr(transaction, "_llm_context_attrs")
29+
2830

2931
@pytest.mark.parametrize("context_attrs", (None, "not-a-dict"))
3032
@background_task()
@@ -33,7 +35,9 @@ def test_llm_custom_attributes_no_attrs(context_attrs):
3335

3436
with pytest.raises(TypeError):
3537
with WithLlmCustomAttributes(context_attrs):
36-
assert transaction._llm_context_attrs is None
38+
pass
39+
40+
assert not hasattr(transaction, "_llm_context_attrs")
3741

3842

3943
@background_task()
@@ -42,3 +46,5 @@ def test_llm_custom_attributes_prefixed_attrs():
4246
with WithLlmCustomAttributes({"llm.test": "attr", "test1": "attr1"}):
4347
# Validate API does not prefix attributes that already begin with "llm."
4448
assert transaction._llm_context_attrs == {"llm.test": "attr", "llm.test1": "attr1"}
49+
50+
assert not hasattr(transaction, "_llm_context_attrs")

0 commit comments

Comments
 (0)