mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-10-14 09:22:11 -05:00
Shrink mypy whitelist for `tests.test_directives.test_directive_patch` (#14139)
Co-authored-by: daniel.eades <daniel.eades@seebyte.com>
This commit is contained in:
1 parent
a03556feb4
commit
ded587ebc6
2 files changed
+16
-4
No files matched your search
@@ -223,7 +223,6 @@ module = [
|
||||
"tests.test_config.test_config",
|
||||
# tests/test_directives
|
||||
"tests.test_directives.test_directive_other",
|
||||
"tests.test_directives.test_directive_patch",
|
||||
# tests/test_domains
|
||||
"tests.test_domains.test_domain_c",
|
||||
"tests.test_domains.test_domain_cpp",
|
||||
|
||||
@@ -47,8 +47,13 @@ def test_code_directive(app: SphinxTestApp) -> None:
|
||||
)
|
||||
|
||||
|
||||
def _as_element(node: nodes.Node) -> nodes.Element:
|
||||
assert isinstance(node, nodes.Element)
|
||||
return node
|
||||
|
||||
|
||||
@pytest.mark.sphinx('html', testroot='directive-csv-table')
|
||||
def test_csv_table_directive(app):
|
||||
def test_csv_table_directive(app: SphinxTestApp) -> None:
|
||||
# relative path from current document
|
||||
text = '.. csv-table::\n :file: example.csv\n'
|
||||
doctree = restructuredtext.parse(app, text, docname='subdir/index')
|
||||
@@ -62,8 +67,12 @@ def test_csv_table_directive(app):
|
||||
],
|
||||
),
|
||||
)
|
||||
table = _as_element(doctree[0])
|
||||
tgroup = _as_element(table[0])
|
||||
tbody = _as_element(tgroup[3])
|
||||
first_row = _as_element(tbody[0])
|
||||
assert_node(
|
||||
doctree[0][0][3][0],
|
||||
first_row,
|
||||
(
|
||||
[nodes.entry, nodes.paragraph, 'FOO'],
|
||||
[nodes.entry, nodes.paragraph, 'BAR'],
|
||||
@@ -84,8 +93,12 @@ def test_csv_table_directive(app):
|
||||
],
|
||||
),
|
||||
)
|
||||
table = _as_element(doctree[0])
|
||||
tgroup = _as_element(table[0])
|
||||
tbody = _as_element(tgroup[3])
|
||||
first_row = _as_element(tbody[0])
|
||||
assert_node(
|
||||
doctree[0][0][3][0],
|
||||
first_row,
|
||||
(
|
||||
[nodes.entry, nodes.paragraph, 'foo'],
|
||||
[nodes.entry, nodes.paragraph, 'bar'],
|
||||
|
||||
Reference in new issue
Block a user