()
| 3361 | |
| 3362 | @requires_matplotlib |
| 3363 | def test_maybe_gca() -> None: |
| 3364 | with figure_context(): |
| 3365 | ax = _maybe_gca(aspect=1) |
| 3366 | |
| 3367 | assert isinstance(ax, mpl.axes.Axes) |
| 3368 | assert ax.get_aspect() == 1 |
| 3369 | |
| 3370 | with figure_context(): |
| 3371 | # create figure without axes |
| 3372 | plt.figure() |
| 3373 | ax = _maybe_gca(aspect=1) |
| 3374 | |
| 3375 | assert isinstance(ax, mpl.axes.Axes) |
| 3376 | assert ax.get_aspect() == 1 |
| 3377 | |
| 3378 | with figure_context(): |
| 3379 | existing_axes = plt.axes() |
| 3380 | ax = _maybe_gca(aspect=1) |
| 3381 | |
| 3382 | # reuses the existing axes |
| 3383 | assert existing_axes == ax |
| 3384 | # kwargs are ignored when reusing axes |
| 3385 | assert ax.get_aspect() == "auto" |
| 3386 | |
| 3387 | |
| 3388 | @requires_matplotlib |
nothing calls this directly
no test coverage detected
searching dependent graphs…