Skip to content

Graph-Native Infrastructure for Context and Accountable AI Systems

Use pytest.approx for float sum comparison in test_llm_cost_tracking (fixes #745) (#746)

Sameer Kadam738698a75bbe
diff --git a/tests/provenance/test_llms_real_tracking.py b/tests/provenance/test_llms_real_tracking.py
index 94ba8588..10d5f032 100644
--- a/tests/provenance/test_llms_real_tracking.py
+++ b/tests/provenance/test_llms_real_tracking.py
@@ -109,7 +109,7 @@ class TestRealLLMProvenanceTracking:
assert lineage is not None
total_cost += lineage["metadata"]["total_cost"]
- assert total_cost == sum(costs)
+ assert total_cost == pytest.approx(sum(costs))
def test_llm_latency_tracking(self):
"""Test that LLM latency is tracked."""