Skip to content

Commit

Permalink
wipe docutils.conf in SphinxTestApp::cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
marxin committed Apr 21, 2023
1 parent 186d596 commit dd95be4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sphinx/testing/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@ def __init__(
) -> None:

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

if builddir is None:
builddir = srcdir / '_build'
Expand Down Expand Up @@ -154,6 +157,8 @@ 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:])
if self.docutilsconfpath:
self.docutilsconfpath.unlink()

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

0 comments on commit dd95be4

Please sign in to comment.