Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1b76817 commit 51876fcCopy full SHA for 51876fc
lib/matplotlib/tests/test_gridspec.py
@@ -1,3 +1,4 @@
1
+import unittest
2
import matplotlib.gridspec as gridspec
3
import matplotlib.pyplot as plt
4
import pytest
@@ -27,6 +28,14 @@ def test_height_ratios():
27
28
gridspec.GridSpec(1, 1, height_ratios=[2, 1, 3])
29
30
31
+def test_SubplotParams():
32
+ s = gridspec.SubplotParams(.1, .1, .9, .9)
33
+ assert s.left == 0.1
34
+
35
+ with pytest.raises(ValueError):
36
+ s = gridspec.SubplotParams(.1, .1, .09, .9)
37
38
39
def test_repr():
40
ss = gridspec.GridSpec(3, 3)[2, 1:3]
41
assert repr(ss) == "GridSpec(3, 3)[2:3, 1:3]"
@@ -48,3 +57,8 @@ def test_subplotspec_args():
48
57
gs = gridspec.GridSpecFromSubplotSpec(2, 1, subplot_spec=axs[0])
49
58
with pytest.raises(TypeError, match="subplot_spec must be type SubplotSpec"):
50
59
gs = gridspec.GridSpecFromSubplotSpec(2, 1, subplot_spec=axs)
60
61
62
+ p = unittest.mock.MagicMock()
63
+ s._repr_pretty_(p, False)
64
+ assert 'SubplotParams' in p.method_calls[0].args[0]
0 commit comments