Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f76c23f

Browse filesBrowse files
committed
add tests
1 parent ceeed8d commit f76c23f
Copy full SHA for f76c23f

File tree

Expand file treeCollapse file tree

1 file changed

+14
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+14
-0
lines changed

‎lib/matplotlib/tests/test_gridspec.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_gridspec.py
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import unittest
12
import matplotlib.gridspec as gridspec
23
import pytest
34

@@ -26,6 +27,14 @@ def test_height_ratios():
2627
gridspec.GridSpec(1, 1, height_ratios=[2, 1, 3])
2728

2829

30+
def test_SubplotParams():
31+
s = gridspec.SubplotParams(.1, .1, .9, .9)
32+
assert s.left == 0.1
33+
34+
with pytest.raises(ValueError):
35+
s = gridspec.SubplotParams(.1, .1, .09, .9)
36+
37+
2938
def test_repr():
3039
ss = gridspec.GridSpec(3, 3)[2, 1:3]
3140
assert repr(ss) == "GridSpec(3, 3)[2:3, 1:3]"
@@ -35,3 +44,8 @@ def test_repr():
3544
width_ratios=(1, 3))
3645
assert repr(ss) == \
3746
"GridSpec(2, 2, height_ratios=(3, 1), width_ratios=(1, 3))"
47+
48+
s = gridspec.SubplotParams(.1, .1, .9, .9)
49+
p = unittest.mock.MagicMock()
50+
s._repr_pretty_(p, False)
51+
assert 'SubplotParams' in p.method_calls[0].args[0]

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.