Skip to content

test(report): strengthen assertion in test_tool_call_count_shown_when_present#343

Merged
decko merged 2 commits into
mainfrom
soda/274
May 26, 2026
Merged

test(report): strengthen assertion in test_tool_call_count_shown_when_present#343
decko merged 2 commits into
mainfrom
soda/274

Conversation

@decko
Copy link
Copy Markdown
Owner

@decko decko commented May 26, 2026

Summary

Strengthens the weak assertion in test_tool_call_count_shown_when_present in tests/test_report_html.py.

Before (weak):

assert "5 tool calls" in content            # could match anywhere in the document
assert 'class="tool-call-count"' in content  # could match the CSS definition block

These two separate checks could each pass independently in the wrong places — e.g., the class name appears in the <style> block (as .tool-call-count { ... }), and the count text could appear in a comment or other element.

After (strong):

assert '<span class="tool-call-count">5 tool calls</span>' in content

This single atomic assertion verifies both the count value and the CSS class appear together in the correct HTML element, exactly matching the Jinja2 template output. This eliminates false positives from independent substring matches.

Acceptance Criteria

  • The weak two-part assertion is replaced with a single atomic HTML element check
  • The new assertion matches the actual Jinja2 template output
  • All existing tests continue to pass (1845 tests, 4 skipped)
  • No regressions introduced

Review Results

Specialist Verdict Findings
Implementation ✅ PASS 0 issues
Verification ✅ PASS All 1845 tests pass, lint clean
Review ✅ pass 0 findings

Refs #274

Assisted-by: Claude Opus 4.6 (1M context) noreply@anthropic.com
Assigned-by: decko

decko added 2 commits May 26, 2026 11:10
…#274)

Replace two separate weak substring checks with a single atomic assertion
that verifies the exact rendered HTML element structure.

Old approach (weak):
- assert "5 tool calls" in content        # could match anywhere (comment, body text)
- assert 'class="tool-call-count"' in content  # could match CSS definition

New approach (strong):
- assert '<span class="tool-call-count">5 tool calls</span>' in content

The single combined assertion confirms that both the count value and CSS class
appear together in the correct element, ruling out false positives from
unrelated matches in the CSS block or document body.
@decko decko added the ai-assisted Implemented with AI assistance label May 26, 2026
@decko decko merged commit f03d260 into main May 26, 2026
4 checks passed
@decko decko deleted the soda/274 branch May 26, 2026 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-assisted Implemented with AI assistance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant