Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion sphinx/testing/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,9 @@ def __init__(
parallel: int = 0,
) -> None:

self.docutils_conf_path = srcdir / 'docutils.conf'
if docutilsconf is not None:
(srcdir / 'docutils.conf').write_text(docutilsconf)
self.docutils_conf_path.write_text(docutilsconf)

if builddir is None:
builddir = srcdir / '_build'
Expand Down Expand Up @@ -154,6 +155,10 @@ def cleanup(self, doctrees: bool = False) -> None:
method not in self._saved_nodeclasses:
delattr(nodes.GenericNodeVisitor, 'visit_' + method[6:])
delattr(nodes.GenericNodeVisitor, 'depart_' + method[6:])
try:
os.remove(self.docutils_conf_path)
except FileNotFoundError:
pass

def __repr__(self) -> str:
return f'<{self.__class__.__name__} buildername={self.builder.name!r}>'
Expand Down