|
2 | 2 |
|
3 | 3 | import pytest
|
4 | 4 |
|
5 |
| -from .conftest import check_xpath, flat_dict |
| 5 | +from .conftest import check_xpath |
6 | 6 |
|
7 | 7 |
|
8 | 8 | @pytest.mark.parametrize(
|
9 |
| - "fname,expect", |
10 |
| - flat_dict( |
11 |
| - { |
12 |
| - 'index.html': [ |
| 9 | + "fname,expect_list", |
| 10 | + [ |
| 11 | + ( |
| 12 | + 'index.html', |
| 13 | + [ |
13 | 14 | (".//h1", 'Sample'),
|
14 | 15 | (".//h1", 'blah-blah', False),
|
15 | 16 | (".//div[@class='highlight']//span", 'usage'),
|
|
21 | 22 | (".//section[@id='bar-options']", ''),
|
22 | 23 | (".//section[@id='bar-options']/dl/dt[1]/kbd", '--bar'),
|
23 | 24 | ],
|
24 |
| - 'subcommand-a.html': [ |
| 25 | + ), |
| 26 | + ( |
| 27 | + 'subcommand-a.html', |
| 28 | + [ |
25 | 29 | (".//h1", 'Sample', False),
|
26 | 30 | (".//h1", 'Command A'),
|
27 | 31 | (".//div[@class='highlight']//span", 'usage'),
|
28 | 32 | (".//h2", 'Positional Arguments'),
|
29 | 33 | (".//section[@id='positional-arguments']", ''),
|
30 | 34 | (".//section[@id='positional-arguments']/dl/dt[1]/kbd", 'baz'),
|
31 | 35 | ],
|
32 |
| - 'special-characters.html': [ |
| 36 | + ), |
| 37 | + ( |
| 38 | + 'special-characters.html', |
| 39 | + [ |
33 | 40 | (".//h1", 'Sample', False),
|
34 | 41 | (".//h1", 'Special Characters'),
|
35 | 42 | (".//section/dl/dd/p", 'Default:'),
|
36 | 43 | (".//section/dl/dd/p/code/span", '420'),
|
37 | 44 | (".//section/dl/dd/p/code/span", "'*.rst"),
|
38 | 45 | (".//section/dl/dd/p/code/span", r"\['\*.rst',"),
|
39 | 46 | ],
|
40 |
| - } |
41 |
| - ), |
| 47 | + ), |
| 48 | + ], |
42 | 49 | )
|
43 | 50 | @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): |
45 | 52 | app.build()
|
46 | 53 | 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