Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ dependencies:
- psutil
- prek
- pydocstyle>=5.1.0
- pytest!=4.6.0,!=5.4.0,!=8.1.0,<9.1.0
- pytest!=4.6.0,!=5.4.0,!=8.1.0
- pytest-cov
- pytest-rerunfailures
- pytest-timeout
Expand Down
4 changes: 2 additions & 2 deletions lib/matplotlib/tests/test_animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def gen_writers():
# Smoke test for saving animations. In the future, we should probably
# design more sophisticated tests which compare resulting frames a-la
# matplotlib.testing.image_comparison
@pytest.mark.parametrize('writer, frame_format, output', gen_writers())
@pytest.mark.parametrize('writer, frame_format, output', list(gen_writers()))
@pytest.mark.parametrize('anim', [dict(klass=dict)], indirect=['anim'])
def test_save_animation_smoketest(tmp_path, writer, frame_format, output, anim):
if frame_format is not None:
Expand All @@ -201,7 +201,7 @@ def test_save_animation_smoketest(tmp_path, writer, frame_format, output, anim):
del anim


@pytest.mark.parametrize('writer, frame_format, output', gen_writers())
@pytest.mark.parametrize('writer, frame_format, output', list(gen_writers()))
def test_grabframe(tmp_path, writer, frame_format, output):
WriterClass = animation.writers[writer]

Expand Down
8 changes: 4 additions & 4 deletions lib/matplotlib/tests/test_mathtext.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def baseline_images(request, fontset, index, text):


@pytest.mark.parametrize(
'index, text', enumerate(math_tests), ids=range(len(math_tests)))
'index, text', list(enumerate(math_tests)), ids=range(len(math_tests)))
@pytest.mark.parametrize(
'fontset', ['cm', 'stix', 'stixsans', 'dejavusans', 'dejavuserif'])
@pytest.mark.parametrize('baseline_images', ['mathtext'], indirect=True)
Expand All @@ -237,7 +237,7 @@ def test_mathtext_rendering(baseline_images, fontset, index, text):
horizontalalignment='center', verticalalignment='center')


@pytest.mark.parametrize('index, text', enumerate(svgastext_math_tests),
@pytest.mark.parametrize('index, text', list(enumerate(svgastext_math_tests)),
ids=range(len(svgastext_math_tests)))
@pytest.mark.parametrize('fontset', ['cm', 'dejavusans'])
@pytest.mark.parametrize('baseline_images', ['mathtext0'], indirect=True)
Expand All @@ -254,7 +254,7 @@ def test_mathtext_rendering_svgastext(baseline_images, fontset, index, text):
horizontalalignment='center', verticalalignment='center')


@pytest.mark.parametrize('index, text', enumerate(lightweight_math_tests),
@pytest.mark.parametrize('index, text', list(enumerate(lightweight_math_tests)),
ids=range(len(lightweight_math_tests)))
@pytest.mark.parametrize('fontset', ['dejavusans'])
@pytest.mark.parametrize('baseline_images', ['mathtext1'], indirect=True)
Expand All @@ -266,7 +266,7 @@ def test_mathtext_rendering_lightweight(baseline_images, fontset, index, text):


@pytest.mark.parametrize(
'index, text', enumerate(font_tests), ids=range(len(font_tests)))
'index, text', list(enumerate(font_tests)), ids=range(len(font_tests)))
@pytest.mark.parametrize(
'fontset', ['cm', 'stix', 'stixsans', 'dejavusans', 'dejavuserif'])
@pytest.mark.parametrize('baseline_images', ['mathfont'], indirect=True)
Expand Down
8 changes: 2 additions & 6 deletions lib/matplotlib/tests/test_mlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ def test_detrend_linear_2d(self):
scope='class')
class TestSpectral:
@pytest.fixture(scope='class', autouse=True)
def stim(self, request, fstims, iscomplex, sides, len_x, NFFT_density,
@classmethod
def stim(cls, request, fstims, iscomplex, sides, len_x, NFFT_density,
nover_density, pad_to_density, pad_to_spectrum):
Fs = 100.

Expand Down Expand Up @@ -323,11 +324,6 @@ def stim(self, request, fstims, iscomplex, sides, len_x, NFFT_density,
if iscomplex:
y = y.astype('complex')

# Interestingly, the instance on which this fixture is called is not
# the same as the one on which a test is run. So we need to modify the
# class itself when using a class-scoped fixture.
cls = request.cls

cls.Fs = Fs
cls.sides = sides
cls.fstims = fstims
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/tests/test_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def test_contains_points_negative_radius():
(1., 2., 1., 2.)]


@pytest.mark.parametrize('path, extents', zip(_test_paths, _test_path_extents))
@pytest.mark.parametrize('path, extents', list(zip(_test_paths, _test_path_extents)))
def test_exact_extents(path, extents):
# notice that if we just looked at the control points to get the bounding
# box of each curve, we would get the wrong answers. For example, for
Expand Down
4 changes: 2 additions & 2 deletions lib/matplotlib/tests/test_rcparams.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ def generate_validator_testcases(valid):


@pytest.mark.parametrize('validator, arg, target',
generate_validator_testcases(True))
list(generate_validator_testcases(True)))
def test_validator_valid(validator, arg, target):
res = validator(arg)
if isinstance(target, np.ndarray):
Expand All @@ -457,7 +457,7 @@ def test_validator_valid(validator, arg, target):


@pytest.mark.parametrize('validator, arg, exception_type',
generate_validator_testcases(False))
list(generate_validator_testcases(False)))
def test_validator_invalid(validator, arg, exception_type):
with pytest.raises(exception_type):
validator(arg)
Expand Down
4 changes: 2 additions & 2 deletions lib/matplotlib/tests/test_ticker.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ class TestLogitLocator:

@pytest.mark.parametrize(
"lims, expected_low_ticks",
zip(ref_basic_limits, ref_basic_major_ticks),
list(zip(ref_basic_limits, ref_basic_major_ticks)),
)
def test_basic_major(self, lims, expected_low_ticks):
"""
Expand Down Expand Up @@ -506,7 +506,7 @@ def test_nbins_major(self, lims):

@pytest.mark.parametrize(
"lims, expected_low_ticks",
zip(ref_basic_limits, ref_basic_major_ticks),
list(zip(ref_basic_limits, ref_basic_major_ticks)),
)
def test_minor(self, lims, expected_low_ticks):
"""
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ test = [
"certifi",
"coverage!=6.3",
"psutil; sys_platform != 'cygwin'",
"pytest!=4.6.0,!=5.4.0,!=8.1.0,<9.1.0",
"pytest!=4.6.0,!=5.4.0,!=8.1.0",
"pytest-cov",
"pytest-rerunfailures!=16.0",
"pytest-timeout",
Expand Down
Loading