Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 98c1745

Browse files
rgbmrcQuLogic
andauthored
parametrize test_grid_axes_position
Co-authored-by: Elliott Sales de Andrade <[email protected]>
1 parent 69828e7 commit 98c1745

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/mpl_toolkits/tests/test_axes_grid1.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -483,12 +483,12 @@ def test_grid_axes_lists():
483483
assert_array_equal(grid, np.ravel(grid.axes_column), "column")
484484

485485

486-
def test_grid_axes_position():
486+
@pytest.mark.parametrize('direction', ('row', 'column'))
487+
def test_grid_axes_position(direction):
487488
"""Test positioning of the axes in Grid."""
488489
fig = plt.figure()
489-
for dir in ("row", "column"):
490-
grid = Grid(fig, 111, (2, 2), direction=dir)
491-
loc = [ax.get_axes_locator() for ax in np.ravel(grid.axes_row)]
492-
assert loc[1]._nx > loc[0]._nx and loc[2]._ny < loc[0]._ny, dir
493-
assert loc[0]._nx == loc[2]._nx and loc[0]._ny == loc[1]._ny, dir
494-
assert loc[3]._nx == loc[1]._nx and loc[3]._ny == loc[2]._ny, dir
490+
grid = Grid(fig, 111, (2, 2), direction=direction)
491+
loc = [ax.get_axes_locator() for ax in np.ravel(grid.axes_row)]
492+
assert loc[1]._nx > loc[0]._nx and loc[2]._ny < loc[0]._ny
493+
assert loc[0]._nx == loc[2]._nx and loc[0]._ny == loc[1]._ny
494+
assert loc[3]._nx == loc[1]._nx and loc[3]._ny == loc[2]._ny

0 commit comments

Comments
 (0)