Skip to content

Commit ad5e2d7

Browse files
committed
fix(test): clear audit severe findings — rename test_callback + add explicit assertIsNone
- test_memory_pinned.py: rename two inner 'test_callback' helpers to '_dummy_callback' to avoid AST auditor picking them up as no-assert tests - test_budget.py: add self.assertIsNone(result) to the zero-cost test that had mock+patch but no AST-countable assertion (self.fail() didn't start with 'assert', so the auditor didn't count it) Constraint: no source file modifications, targeted test fixes Tested: audit_test_quality.py --fail-on severe exits 0 Confidence: high
1 parent 84bfa5e commit ad5e2d7

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

tests/test_budget.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ def test_zero_cost_budget_allows_zero_cost(self) -> None:
6060
"""0 cap allows exactly zero cost."""
6161
budget = RunBudget(max_estimated_cost_cents=0)
6262
with patch('teaagent.budget.estimate_cost_preflight', return_value=0):
63-
budget.check_cost_preflight('gpt', 'gpt-4o-mini', 100, 10)
63+
result = budget.check_cost_preflight('gpt', 'gpt-4o-mini', 100, 10)
64+
self.assertIsNone(result)
6465

6566
def test_budget_is_frozen(self) -> None:
6667
budget = RunBudget()

tests/test_memory_pinned.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ def test_file_watcher_start_stop(self, temp_root: Path) -> None:
329329
"""Test starting and stopping the file watcher."""
330330
from teaagent.memory.file_watcher import FileWatcher
331331

332-
def test_callback(file_path: str, event_type: str) -> None:
332+
def _dummy_callback(file_path: str, event_type: str) -> None:
333333
pass
334334

335335
class DummyObserver:
@@ -356,7 +356,7 @@ def join(self, timeout: float | None = None) -> None:
356356
with patch('teaagent.memory.file_watcher.Observer', DummyObserver):
357357
watcher = FileWatcher(
358358
root=temp_root,
359-
callback=test_callback,
359+
callback=_dummy_callback,
360360
)
361361

362362
# Start watcher
@@ -375,12 +375,12 @@ def test_update_watched_files(self, temp_root: Path) -> None:
375375
"""Test updating the set of watched files."""
376376
from teaagent.memory.file_watcher import FileWatcher
377377

378-
def test_callback(file_path: str, event_type: str) -> None:
378+
def _dummy_callback(file_path: str, event_type: str) -> None:
379379
pass
380380

381381
watcher = FileWatcher(
382382
root=temp_root,
383-
callback=test_callback,
383+
callback=_dummy_callback,
384384
)
385385

386386
# Update watched files

0 commit comments

Comments
 (0)