Skip to content

Commit eba6a98

Browse files
committed
TST: add test of slightly odd corner cases
1 parent e73c1a9 commit eba6a98

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

lib/matplotlib/tests/test_figure.py

+21
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,14 @@ def test_nested(self, fig_test, fig_ref):
564564
fig_test.tight_layout()
565565
fig_ref.tight_layout()
566566

567+
@check_figures_equal(tol=0.005, extensions=['png'])
568+
def test_nested_tuple(self, fig_test, fig_ref):
569+
x = [["A", "B", "B"], ["C", "C", "D"]]
570+
xt = (("A", "B", "B"), ("C", "C", "D"))
571+
572+
fig_ref.build_grid([["F"], [x]])
573+
fig_test.build_grid([["F"], [xt]])
574+
567575
@check_figures_equal(extensions=['png'])
568576
@pytest.mark.parametrize('x, empty_sentinel', [
569577
([["A", None], [None, "B"]], None),
@@ -645,3 +653,16 @@ def test_fail(self, x, match):
645653
ValueError,
646654
match=match):
647655
fig.build_grid(x)
656+
657+
@check_figures_equal(extensions=['png'])
658+
def test_hashable_keys(self, fig_test, fig_ref):
659+
fig_test.build_grid([[object(), object()]])
660+
fig_ref.build_grid([['A', 'B']])
661+
662+
@check_figures_equal(extensions=['png'])
663+
def test_mixed(self, fig_test, fig_ref):
664+
for k, ax in fig_ref.build_grid([['A', None, 'B']]).items():
665+
ax.set_title(k)
666+
ax = fig_test.subplots()
667+
ax.set_title('B')
668+
fig_test.build_grid([['A', None, ax]])['A'].set_title('A')

0 commit comments

Comments
 (0)