Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5892 from julianvmodesto/master
Fix gridspec.Gridspec: check ratios for consistency with rows and columns
- Loading branch information
1 parent
52877ca
commit 308ce5d
Showing
2 changed files
with
25 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,26 @@ | ||
import matplotlib.gridspec as gridspec | ||
from nose.tools import assert_equal | ||
from nose.tools import assert_raises, assert_equal | ||
|
||
|
||
def test_equal(): | ||
gs = gridspec.GridSpec(2, 1) | ||
assert_equal(gs[0, 0], gs[0, 0]) | ||
assert_equal(gs[:, 0], gs[:, 0]) | ||
|
||
|
||
def test_width_ratios(): | ||
""" | ||
Addresses issue #5835. | ||
See at https://github.com/matplotlib/matplotlib/issues/5835. | ||
""" | ||
assert_raises(ValueError, gridspec.GridSpec, | ||
1, 1, width_ratios=[2, 1, 3]) | ||
|
||
|
||
def test_height_ratios(): | ||
""" | ||
Addresses issue #5835. | ||
See at https://github.com/matplotlib/matplotlib/issues/5835. | ||
""" | ||
assert_raises(ValueError, gridspec.GridSpec, | ||
1, 1, height_ratios=[2, 1, 3]) |