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

Skip to content

Commit 8ef7b49

Browse files
committed
TST: Add test to make sure kwargs dicts aren't mutated by subplots
1 parent 764fbe5 commit 8ef7b49

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/matplotlib/tests/test_subplots.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,3 +149,12 @@ def test_get_gridspec():
149149
# ahem, pretty trivial, but...
150150
fig, ax = plt.subplots()
151151
assert ax.get_subplotspec().get_gridspec() == ax.get_gridspec()
152+
153+
154+
def test_dont_mutate_kwargs():
155+
subplot_kw = {'sharex': 'all'}
156+
gridspec_kw = {'width_ratios': [1, 2]}
157+
fig, ax = plt.subplots(1, 2, subplot_kw=subplot_kw,
158+
gridspec_kw=gridspec_kw)
159+
assert subplot_kw == {'sharex': 'all'}
160+
assert gridspec_kw == {'width_ratios': [1, 2]}

0 commit comments

Comments
 (0)