MCPcopy Index your code
hub / github.com/pydata/xarray / test_get_axis_raises

Function test_get_axis_raises

xarray/tests/test_plot.py:3277–3298  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3275
3276@requires_matplotlib
3277def test_get_axis_raises() -> None:
3278 # test get_axis raises an error if trying to do invalid things
3279
3280 # cannot provide both ax and figsize
3281 with pytest.raises(ValueError, match="both `figsize` and `ax`"):
3282 get_axis(figsize=[4, 4], size=None, aspect=None, ax="something") # type: ignore[arg-type]
3283
3284 # cannot provide both ax and size
3285 with pytest.raises(ValueError, match="both `size` and `ax`"):
3286 get_axis(figsize=None, size=200, aspect=4 / 3, ax="something") # type: ignore[arg-type]
3287
3288 # cannot provide both size and figsize
3289 with pytest.raises(ValueError, match="both `figsize` and `size`"):
3290 get_axis(figsize=[4, 4], size=200, aspect=None, ax=None)
3291
3292 # cannot provide aspect and size
3293 with pytest.raises(ValueError, match="`aspect` argument without `size`"):
3294 get_axis(figsize=None, size=None, aspect=4 / 3, ax=None)
3295
3296 # cannot provide axis and subplot_kws
3297 with pytest.raises(ValueError, match="cannot use subplot_kws with existing ax"):
3298 get_axis(figsize=None, size=None, aspect=None, ax=1, something_else=5) # type: ignore[arg-type]
3299
3300
3301@requires_matplotlib

Callers

nothing calls this directly

Calls 1

get_axisFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…