Skip to content

Commit 4051354

Browse files
authored
Mark tests as expected failures on Docutils 0.22.0rc2 (#13547)
1 parent 7838043 commit 4051354

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

tests/test_directives/test_directive_only.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,20 @@
55
import re
66
from typing import TYPE_CHECKING
77

8+
import docutils
89
import pytest
910
from docutils import nodes
1011

1112
if TYPE_CHECKING:
1213
from sphinx.testing.util import SphinxTestApp
1314

15+
xfail_du_22 = pytest.mark.xfail(
16+
docutils.__version_info__ >= (0, 22, 0, 'alpha', 0),
17+
reason='expected failure on Docutils 0.22+',
18+
)
1419

20+
21+
@xfail_du_22
1522
@pytest.mark.sphinx('text', testroot='directive-only')
1623
def test_sectioning(app: SphinxTestApp) -> None:
1724
def getsects(section):

tests/test_environment/test_environment_toctree.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
from typing import TYPE_CHECKING
66

7+
import docutils
78
import pytest
89
from docutils import nodes
910
from docutils.nodes import bullet_list, list_item, literal, reference, title
@@ -17,7 +18,13 @@
1718
if TYPE_CHECKING:
1819
from sphinx.testing.util import SphinxTestApp
1920

21+
xfail_du_22 = pytest.mark.xfail(
22+
docutils.__version_info__ >= (0, 22, 0, 'alpha', 0),
23+
reason='expected failure on Docutils 0.22+',
24+
)
2025

26+
27+
@xfail_du_22
2128
@pytest.mark.sphinx('xml', testroot='toctree')
2229
@pytest.mark.test_params(shared_result='test_environment_toctree_basic')
2330
def test_process_doc(app):
@@ -464,6 +471,7 @@ def test_domain_objects_document_scoping(app: SphinxTestApp) -> None:
464471
)
465472

466473

474+
@xfail_du_22
467475
@pytest.mark.sphinx('xml', testroot='toctree')
468476
@pytest.mark.test_params(shared_result='test_environment_toctree_basic')
469477
def test_document_toc(app):
@@ -521,6 +529,7 @@ def test_document_toc(app):
521529
assert_node(toctree[2][0], [compact_paragraph, reference, 'Indices and tables'])
522530

523531

532+
@xfail_du_22
524533
@pytest.mark.sphinx('xml', testroot='toctree')
525534
@pytest.mark.test_params(shared_result='test_environment_toctree_basic')
526535
def test_document_toc_only(app):

tests/test_util/test_util_docutils_sphinx_directive.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
from types import SimpleNamespace
44

5+
import docutils
6+
import pytest
57
from docutils import nodes
68
from docutils.parsers.rst.languages import en as english # type: ignore[attr-defined]
79
from docutils.parsers.rst.states import (
@@ -14,6 +16,11 @@
1416

1517
from sphinx.util.docutils import SphinxDirective, new_document
1618

19+
xfail_du_22 = pytest.mark.xfail(
20+
docutils.__version_info__ >= (0, 22, 0, 'alpha', 0),
21+
reason='expected failure on Docutils 0.22+',
22+
)
23+
1724

1825
def make_directive(
1926
*, env: SimpleNamespace, input_lines: StringList | None = None
@@ -104,6 +111,7 @@ def test_sphinx_directive_get_location() -> None:
104111
assert directive.get_location() == '<source>:1'
105112

106113

114+
@xfail_du_22
107115
def test_sphinx_directive_parse_content_to_nodes() -> None:
108116
directive = make_directive(env=SimpleNamespace())
109117
content = 'spam\n====\n\nEggs! *Lobster thermidor.*'
@@ -120,6 +128,7 @@ def test_sphinx_directive_parse_content_to_nodes() -> None:
120128
assert node.children[1].astext() == 'Eggs! Lobster thermidor.'
121129

122130

131+
@xfail_du_22
123132
def test_sphinx_directive_parse_text_to_nodes() -> None:
124133
directive = make_directive(env=SimpleNamespace())
125134
content = 'spam\n====\n\nEggs! *Lobster thermidor.*'

0 commit comments

Comments
 (0)