File: docutils_0.22.1.diff

package info (click to toggle)
sphinx 8.2.3-7
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 26,712 kB
  • sloc: python: 105,856; javascript: 6,474; perl: 449; makefile: 178; sh: 37; xml: 19; ansic: 2
file content (28 lines) | stat: -rw-r--r-- 1,206 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From: Günter Milde <milde@users.sf.net>
Date: Tue, 9 Sep 2025 16:17:15 +0200
Subject: Fix test setup for directive tests

Set the "parent" attribute of RSTState instances to the `document`
instead of None.  The attribute holds the state machines "current node"
which is initialized to the `document` in `RSTStateMachine.run()` and
required since Docutils 0.22.1 in `RSTState.nested_parse()` to correctly
support sections in nested parsing.

Origin: https://github.com/sphinx-doc/sphinx/pull/13883
---
 tests/test_util/test_util_docutils_sphinx_directive.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/test_util/test_util_docutils_sphinx_directive.py b/tests/test_util/test_util_docutils_sphinx_directive.py
index ecfcab0..7a26e96 100644
--- a/tests/test_util/test_util_docutils_sphinx_directive.py
+++ b/tests/test_util/test_util_docutils_sphinx_directive.py
@@ -38,7 +38,7 @@ def make_directive_and_state(
     inliner = Inliner()
     inliner.init_customizations(state.document.settings)
     state.inliner = inliner
-    state.parent = None
+    state.parent = state.document
     state.memo = SimpleNamespace(
         document=state.document,
         language=english,