Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

test: delete 4 weak tests in test_token_counter_extended.py (#4278)

LearningCircuitcc9e437fc2d6
diff --git a/tests/metrics/test_token_counter_extended.py b/tests/metrics/test_token_counter_extended.py
index ed69e35660..fb61ffa64b 100644
--- a/tests/metrics/test_token_counter_extended.py
+++ b/tests/metrics/test_token_counter_extended.py
@@ -366,16 +366,6 @@ class TestTokenCounting:
class TestCallStackTracking:
"""Tests for call stack tracking functionality"""
- def test_call_stack_push(self):
- """Test call stack is captured on LLM start"""
- callback = TokenCountingCallback()
-
- callback.on_llm_start({"_type": "ChatOpenAI"}, ["test"])
-
- # Call stack may or may not be captured depending on stack depth
- # Just verify the attribute exists
- assert hasattr(callback, "call_stack")
-
def test_call_stack_pop(self):
"""Test call stack info is available after start"""
callback = TokenCountingCallback()
@@ -387,27 +377,6 @@ class TestCallStackTracking:
callback.call_stack, str
)
- def test_nested_call_tracking(self):
- """Test nested calls are tracked"""
- callback = TokenCountingCallback()
-
- # Simulate nested call
- callback.on_llm_start({"_type": "ChatOpenAI"}, ["test"])
-
- # Should have captured calling info
- assert hasattr(callback, "calling_file")
- assert hasattr(callback, "calling_function")
-
- def test_call_depth_calculation(self):
- """Test call depth is properly tracked"""
- callback = TokenCountingCallback()
-
- callback.on_llm_start({"_type": "ChatOpenAI"}, ["test"])
-
- # In test context, may not have project frames
- # Just verify no crash
- assert True
-
def test_call_duration_tracking(self):
"""Test call duration is tracked"""
callback = TokenCountingCallback()
@@ -799,31 +768,6 @@ class TestErrorHandling:
# No tokens counted
assert callback.counts["total_tokens"] == 0
- def test_invalid_token_values(self):
- """Test handling of invalid token values"""
- callback = TokenCountingCallback()
-
- callback.on_llm_start(
- {"_type": "ChatOpenAI"},
- ["test"],
- invocation_params={"model": "gpt-4"},
- )
-
- mock_response = MagicMock()
- mock_response.llm_output = {
- "token_usage": {
- "prompt_tokens": "invalid",
- "completion_tokens": None,
- }
- }
- mock_response.generations = []
-
- # Should handle gracefully
- try:
- callback.on_llm_end(mock_response)
- except (TypeError, ValueError):
- pass # Expected behavior for invalid data
-
class TestModelDetection:
"""Tests for model detection logic"""