1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
| | Patch the tests to prevent the error "pytest ids must be list of strings, found: 0".
The PyTest documentation states that "Numbers, strings, booleans and None will
have their usual string representation used in the test ID. For other objects,
pytest will make a string based on the argument name".
https://docs.pytest.org/en/6.2.x/example/parametrize.html#different-options-for-test-ids
--- a/lib/matplotlib/tests/test_mathtext.py
+++ b/lib/matplotlib/tests/test_mathtext.py
@@ -184,8 +184,7 @@ def baseline_images(request, fontset, index, text):
return ['%s_%s_%02d' % (request.param, fontset, index)]
-@pytest.mark.parametrize(
- 'index, text', enumerate(math_tests), ids=range(len(math_tests)))
+@pytest.mark.parametrize('index, text', enumerate(math_tests))
@pytest.mark.parametrize(
'fontset', ['cm', 'stix', 'stixsans', 'dejavusans', 'dejavuserif'])
@pytest.mark.parametrize('baseline_images', ['mathtext'], indirect=True)
@@ -197,8 +196,7 @@ def test_mathtext_rendering(baseline_images, fontset, index, text):
horizontalalignment='center', verticalalignment='center')
-@pytest.mark.parametrize('index, text', enumerate(lightweight_math_tests),
- ids=range(len(lightweight_math_tests)))
+@pytest.mark.parametrize('index, text', enumerate(lightweight_math_tests))
@pytest.mark.parametrize('fontset', ['dejavusans'])
@pytest.mark.parametrize('baseline_images', ['mathtext1'], indirect=True)
@image_comparison(baseline_images=None, extensions=['png'])
@@ -208,8 +206,7 @@ def test_mathtext_rendering_lightweight(baseline_images, fontset, index, text):
horizontalalignment='center', verticalalignment='center')
-@pytest.mark.parametrize(
- 'index, text', enumerate(font_tests), ids=range(len(font_tests)))
+@pytest.mark.parametrize('index, text', enumerate(font_tests))
@pytest.mark.parametrize(
'fontset', ['cm', 'stix', 'stixsans', 'dejavusans', 'dejavuserif'])
@pytest.mark.parametrize('baseline_images', ['mathfont'], indirect=True)
|