Skip to content

Commit 5d16af5

Browse files
committed
Update conftest.py
1 parent 051db37 commit 5d16af5

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

tests/conftest.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,20 @@
44

55
from docutils import __version_info__ as docutils_version_info
66

7-
# docutils 0.22+ serializes boolean attributes as "1"/"0" instead of "True"/"False"
87
DOCUTILS_0_22_PLUS = docutils_version_info >= (0, 22)
98

109

1110
def normalize_doctree_xml(text: str) -> str:
1211
"""Normalize docutils XML output for cross-version compatibility.
1312
1413
In docutils 0.22+, boolean attributes are serialized as "1"/"0"
15-
instead of "True"/"False". This function normalizes to the new format
14+
instead of "True"/"False". This function normalizes to the old format
1615
for consistent test fixtures.
1716
"""
1817
if DOCUTILS_0_22_PLUS:
19-
# Normalize new format (True/False) to old format (1/0)
18+
# Normalize new format (1/0) to old format (1/0)
2019
# Only replace when it's clearly a boolean attribute value
21-
# Pattern: attribute="True" or attribute="False"
20+
# Pattern: attribute="1" or attribute="0"
2221
attrs = [
2322
"force",
2423
"glob",

0 commit comments

Comments
 (0)