Skip to content

fix: TestPhaseTimelineDotColoring assertions are vacuous due to CSS class definitions in template #271

@decko

Description

@decko

Finding

File: tests/test_report_html.py:2579
Severity: Important

Description

All three TestPhaseTimelineDotColoring tests contain vacuous assertions — e.g. assert "phase-status-rework" in content — that always pass because the CSS <style> block in the HTML template already contains .phase-status-rework, .phase-status-completed, and .phase-status-failed class definitions. As a result, even rendering with include_sessions=False (producing no phase dots at all) would pass all three assertions.

Suggested Fix

Make assertions specific to the rendered HTML element rather than the raw content string. For example:

  • Assert on the full class attribute string only present in a dot <span>: assert 'phase-status phase-status-rework' in content
  • Count occurrences and assert count ≥ 2 (one from CSS, one+ from rendered HTML)
  • Parse with BeautifulSoup/regex to find <span> elements carrying the expected class

Reference

Found during review of PR #270 (fix: HTML report phase timeline ordering and rework coloring). Did not block the PR.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions