Skip to content

Commit ba5ff76

Browse files
nstarmanclaude
andcommitted
🧪 test(charts): check component count for all predefined charts
Broaden test_component_count_matches_for_predefined_charts to loop over every predefined chart instance (discovered via AbstractChart) instead of just cart3d and polar2d, matching the docstring's "every predefined chart" claim. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent c9ef62d commit ba5ff76

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

‎tests/unit/charts/test_base.py‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,5 +219,12 @@ def cartesian(self):
219219

220220
def test_component_count_matches_for_predefined_charts(self) -> None:
221221
"""Every predefined chart's ndim matches its component count."""
222-
assert cxc.cart3d.ndim == len(cxc.cart3d.components) == 3
223-
assert cxc.polar2d.ndim == len(cxc.polar2d.components) == 2
222+
charts = [
223+
obj
224+
for name in dir(cxc)
225+
if not name.startswith("_")
226+
and isinstance(obj := getattr(cxc, name), cxc.AbstractChart)
227+
]
228+
assert charts, "no predefined chart instances discovered"
229+
for chart in charts:
230+
assert chart.ndim == len(chart.components), chart

0 commit comments

Comments
 (0)