Skip to content

Commit a944a88

Browse files
committed
Fixed pytest parameterization
1 parent eefe10b commit a944a88

File tree

1 file changed

+19
-11
lines changed

1 file changed

+19
-11
lines changed

test/test_default_html.py

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22

33
import pytest
44

5-
from .conftest import check_xpath, flat_dict
5+
from .conftest import check_xpath
66

77

88
@pytest.mark.parametrize(
9-
"fname,expect",
10-
flat_dict(
11-
{
12-
'index.html': [
9+
"fname,expect_list",
10+
[
11+
(
12+
'index.html',
13+
[
1314
(".//h1", 'Sample'),
1415
(".//h1", 'blah-blah', False),
1516
(".//div[@class='highlight']//span", 'usage'),
@@ -21,27 +22,34 @@
2122
(".//section[@id='bar-options']", ''),
2223
(".//section[@id='bar-options']/dl/dt[1]/kbd", '--bar'),
2324
],
24-
'subcommand-a.html': [
25+
),
26+
(
27+
'subcommand-a.html',
28+
[
2529
(".//h1", 'Sample', False),
2630
(".//h1", 'Command A'),
2731
(".//div[@class='highlight']//span", 'usage'),
2832
(".//h2", 'Positional Arguments'),
2933
(".//section[@id='positional-arguments']", ''),
3034
(".//section[@id='positional-arguments']/dl/dt[1]/kbd", 'baz'),
3135
],
32-
'special-characters.html': [
36+
),
37+
(
38+
'special-characters.html',
39+
[
3340
(".//h1", 'Sample', False),
3441
(".//h1", 'Special Characters'),
3542
(".//section/dl/dd/p", 'Default:'),
3643
(".//section/dl/dd/p/code/span", '420'),
3744
(".//section/dl/dd/p/code/span", "'*.rst"),
3845
(".//section/dl/dd/p/code/span", r"\['\*.rst',"),
3946
],
40-
}
41-
),
47+
),
48+
],
4249
)
4350
@pytest.mark.sphinx('html', testroot='default-html')
44-
def test_default_html(app, cached_etree_parse, fname, expect):
51+
def test_default_html(app, cached_etree_parse, fname, expect_list):
4552
app.build()
4653
print(app.outdir / fname)
47-
check_xpath(cached_etree_parse(app.outdir / fname), fname, *expect)
54+
for expect in expect_list:
55+
check_xpath(cached_etree_parse(app.outdir / fname), fname, *expect)

0 commit comments

Comments
 (0)