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

Skip to content

Commit 3c36a50

Browse files
VladimirQuLogic
Vladimir
authored andcommitted
refactor: Take out use_rcparam in separate parametrizing
1 parent 24f71f1 commit 3c36a50

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
@@ -211,22 +211,16 @@ def test_additional(self, lim, ref):
211211

212212
assert_almost_equal(ax.yaxis.get_ticklocs(minor=True), ref)
213213

214+
@pytest.mark.parametrize('use_rcparam', [False, True])
214215
@pytest.mark.parametrize(
215-
'lim, ref, use_rcparam', [
216+
'lim, ref', [
216217
((0, 1.39),
217218
[0.05, 0.1, 0.15, 0.25, 0.3, 0.35, 0.45, 0.5, 0.55, 0.65, 0.7,
218-
0.75, 0.85, 0.9, 0.95, 1.05, 1.1, 1.15, 1.25, 1.3, 1.35], True),
219-
((0, 1.39),
220-
[0.05, 0.1, 0.15, 0.25, 0.3, 0.35, 0.45, 0.5, 0.55, 0.65, 0.7,
221-
0.75, 0.85, 0.9, 0.95, 1.05, 1.1, 1.15, 1.25, 1.3, 1.35], False),
222-
((0, 0.139),
223-
[0.005, 0.01, 0.015, 0.025, 0.03, 0.035, 0.045, 0.05, 0.055,
224-
0.065, 0.07, 0.075, 0.085, 0.09, 0.095, 0.105, 0.11, 0.115,
225-
0.125, 0.13, 0.135], True),
219+
0.75, 0.85, 0.9, 0.95, 1.05, 1.1, 1.15, 1.25, 1.3, 1.35]),
226220
((0, 0.139),
227221
[0.005, 0.01, 0.015, 0.025, 0.03, 0.035, 0.045, 0.05, 0.055,
228222
0.065, 0.07, 0.075, 0.085, 0.09, 0.095, 0.105, 0.11, 0.115,
229-
0.125, 0.13, 0.135], False),
223+
0.125, 0.13, 0.135]),
230224
])
231225
def test_number_of_minor_ticks_auto(self, lim, ref, use_rcparam):
232226
if use_rcparam:
@@ -245,14 +239,12 @@ def test_number_of_minor_ticks_auto(self, lim, ref, use_rcparam):
245239
assert_almost_equal(ax.xaxis.get_ticklocs(minor=True), ref)
246240
assert_almost_equal(ax.yaxis.get_ticklocs(minor=True), ref)
247241

242+
@pytest.mark.parametrize('use_rcparam', [False, True])
248243
@pytest.mark.parametrize(
249-
'n, lim, ref, use_rcparam', [
250-
(2, (0, 4), [0.5, 1.5, 2.5, 3.5], True),
251-
(2, (0, 4), [0.5, 1.5, 2.5, 3.5], False),
252-
(4, (0, 2), [0.25, 0.5, 0.75, 1.25, 1.5, 1.75], True),
253-
(4, (0, 2), [0.25, 0.5, 0.75, 1.25, 1.5, 1.75], False),
254-
(10, (0, 1), [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9], True),
255-
(10, (0, 1), [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9], False),
244+
'n, lim, ref', [
245+
(2, (0, 4), [0.5, 1.5, 2.5, 3.5]),
246+
(4, (0, 2), [0.25, 0.5, 0.75, 1.25, 1.5, 1.75]),
247+
(10, (0, 1), [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]),
256248
])
257249
def test_number_of_minor_ticks_int(self, n, lim, ref, use_rcparam):
258250
if use_rcparam:

0 commit comments

Comments
 (0)