Skip to content

Commit 54dc6b7

Browse files
committed
Fix test_sectioning for Docutils 0.22+
1 parent 5355a78 commit 54dc6b7

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

sphinx/writers/text.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,7 @@ def depart_document(self, node: Element) -> None:
479479
# XXX header/footer?
480480

481481
def visit_section(self, node: Element) -> None:
482+
assert self.sectionlevel < 7, node.pformat(' ')
482483
self._title_char = self.sectionchars[self.sectionlevel]
483484
self.sectionlevel += 1
484485

tests/test_directives/test_directive_only.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,7 @@
1212
if TYPE_CHECKING:
1313
from sphinx.testing.util import SphinxTestApp
1414

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-
)
1915

20-
21-
@xfail_du_22
2216
@pytest.mark.sphinx('text', testroot='directive-only')
2317
def test_sectioning(app: SphinxTestApp) -> None:
2418
def getsects(section):

0 commit comments

Comments
 (0)