MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_empty

Method test_empty

lib/matplotlib/tests/test_figure.py:1154–1175  ·  view source on GitHub ↗
(self, fig_test, fig_ref, x, empty_sentinel)

Source from the content-addressed store, hash-verified

1152 ],
1153 )
1154 def test_empty(self, fig_test, fig_ref, x, empty_sentinel):
1155 if empty_sentinel != "SKIP":
1156 kwargs = {"empty_sentinel": empty_sentinel}
1157 else:
1158 kwargs = {}
1159 grid_axes = fig_test.subplot_mosaic(x, **kwargs)
1160
1161 for k, ax in grid_axes.items():
1162 ax.set_title(k)
1163
1164 labels = sorted(
1165 {name for row in x for name in row} - {empty_sentinel, "."}
1166 )
1167
1168 assert len(labels) == len(grid_axes)
1169
1170 gs = fig_ref.add_gridspec(2, 2)
1171 axA = fig_ref.add_subplot(gs[0, 0])
1172 axA.set_title(labels[0])
1173
1174 axB = fig_ref.add_subplot(gs[1, 1])
1175 axB.set_title(labels[1])
1176
1177 def test_fail_list_of_str(self):
1178 with pytest.raises(ValueError, match='must be 2D'):

Callers

nothing calls this directly

Calls 4

subplot_mosaicMethod · 0.80
add_gridspecMethod · 0.80
add_subplotMethod · 0.80
set_titleMethod · 0.45

Tested by

no test coverage detected