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

Skip to content

Commit 0b0bab5

Browse files
author
Vladimir
committed
refactor: Take out use_rcparam in separate parametrizing
1 parent c5a8246 commit 0b0bab5

File tree

1 file changed

+9
-17
lines changed

1 file changed

+9
-17
lines changed

lib/matplotlib/tests/test_ticker.py

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -192,22 +192,16 @@ def test_additional(self, lim, ref):
192192

193193
assert_almost_equal(ax.yaxis.get_ticklocs(minor=True), ref)
194194

195+
@pytest.mark.parametrize('use_rcparam', [False, True])
195196
@pytest.mark.parametrize(
196-
'lim, ref, use_rcparam', [
197+
'lim, ref', [
197198
((0, 1.39),
198199
[0.05, 0.1, 0.15, 0.25, 0.3, 0.35, 0.45, 0.5, 0.55, 0.65, 0.7,
199-
0.75, 0.85, 0.9, 0.95, 1.05, 1.1, 1.15, 1.25, 1.3, 1.35], True),
200-
((0, 1.39),
201-
[0.05, 0.1, 0.15, 0.25, 0.3, 0.35, 0.45, 0.5, 0.55, 0.65, 0.7,
202-
0.75, 0.85, 0.9, 0.95, 1.05, 1.1, 1.15, 1.25, 1.3, 1.35], False),
203-
((0, 0.139),
204-
[0.005, 0.01, 0.015, 0.025, 0.03, 0.035, 0.045, 0.05, 0.055,
205-
0.065, 0.07, 0.075, 0.085, 0.09, 0.095, 0.105, 0.11, 0.115,
206-
0.125, 0.13, 0.135], True),
200+
0.75, 0.85, 0.9, 0.95, 1.05, 1.1, 1.15, 1.25, 1.3, 1.35]),
207201
((0, 0.139),
208202
[0.005, 0.01, 0.015, 0.025, 0.03, 0.035, 0.045, 0.05, 0.055,
209203
0.065, 0.07, 0.075, 0.085, 0.09, 0.095, 0.105, 0.11, 0.115,
210-
0.125, 0.13, 0.135], False),
204+
0.125, 0.13, 0.135]),
211205
])
212206
def test_number_of_minor_ticks_auto(self, lim, ref, use_rcparam):
213207
if use_rcparam:
@@ -227,14 +221,12 @@ def test_number_of_minor_ticks_auto(self, lim, ref, use_rcparam):
227221
assert_almost_equal(ax.xaxis.get_ticklocs(minor=True), ref)
228222
assert_almost_equal(ax.yaxis.get_ticklocs(minor=True), ref)
229223

224+
@pytest.mark.parametrize('use_rcparam', [False, True])
230225
@pytest.mark.parametrize(
231-
'n, lim, ref, use_rcparam', [
232-
(2, (0, 4), [0.5, 1.5, 2.5, 3.5], True),
233-
(2, (0, 4), [0.5, 1.5, 2.5, 3.5], False),
234-
(4, (0, 2), [0.25, 0.5, 0.75, 1.25, 1.5, 1.75], True),
235-
(4, (0, 2), [0.25, 0.5, 0.75, 1.25, 1.5, 1.75], False),
236-
(10, (0, 1), [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9], True),
237-
(10, (0, 1), [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9], False),
226+
'n, lim, ref', [
227+
(2, (0, 4), [0.5, 1.5, 2.5, 3.5]),
228+
(4, (0, 2), [0.25, 0.5, 0.75, 1.25, 1.5, 1.75]),
229+
(10, (0, 1), [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]),
238230
])
239231
def test_number_of_minor_ticks_int(self, n, lim, ref, use_rcparam):
240232
if use_rcparam:

0 commit comments

Comments
 (0)