Skip to content

Commit ed947c3

Browse files
committed
Improve test
1 parent 256c963 commit ed947c3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/test_accessor.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -468,10 +468,11 @@ def test_colors_ignored_with_warning_when_px_kwargs_present(self) -> None:
468468
fig = self.da.plotly.line(
469469
colors="D3", color_discrete_sequence=["orange", "purple", "cyan"]
470470
)
471-
# Should have raised a warning
472-
assert len(w) == 1
473-
assert "colors" in str(w[0].message).lower()
474-
assert "ignored" in str(w[0].message).lower()
471+
# Should have raised a warning about colors being ignored
472+
assert any(
473+
"colors" in str(m.message).lower() and "ignored" in str(m.message).lower()
474+
for m in w
475+
), "Expected warning about 'colors' being 'ignored' not found"
475476
# The explicit px_kwargs should take precedence
476477
assert fig.data[0].line.color == "orange"
477478

0 commit comments

Comments
 (0)