mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix a bug in FilenameUniqDict that led to test failures.
This commit is contained in:
parent
8bf6fa5a74
commit
bd5eb9f417
@ -307,7 +307,7 @@ class FilenameUniqDict(dict):
|
|||||||
def add_file(self, docname, newfile):
|
def add_file(self, docname, newfile):
|
||||||
if newfile in self:
|
if newfile in self:
|
||||||
self[newfile][0].add(docname)
|
self[newfile][0].add(docname)
|
||||||
return
|
return self[newfile][1]
|
||||||
uniquename = path.basename(newfile)
|
uniquename = path.basename(newfile)
|
||||||
base, ext = path.splitext(uniquename)
|
base, ext = path.splitext(uniquename)
|
||||||
i = 0
|
i = 0
|
||||||
@ -321,8 +321,9 @@ class FilenameUniqDict(dict):
|
|||||||
def purge_doc(self, docname):
|
def purge_doc(self, docname):
|
||||||
for filename, (docs, _) in self.items():
|
for filename, (docs, _) in self.items():
|
||||||
docs.discard(docname)
|
docs.discard(docname)
|
||||||
if not docs:
|
#if not docs:
|
||||||
del self[filename]
|
# del self[filename]
|
||||||
|
# self._existing.discard(filename)
|
||||||
|
|
||||||
def __getstate__(self):
|
def __getstate__(self):
|
||||||
return self._existing
|
return self._existing
|
||||||
|
@ -30,6 +30,10 @@ from sphinx.builders.latex import LaTeXBuilder
|
|||||||
from sphinx.writers.latex import LaTeXTranslator
|
from sphinx.writers.latex import LaTeXTranslator
|
||||||
|
|
||||||
|
|
||||||
|
def teardown_module():
|
||||||
|
(test_root / '_build').rmtree()
|
||||||
|
|
||||||
|
|
||||||
html_warnfile = StringIO()
|
html_warnfile = StringIO()
|
||||||
latex_warnfile = StringIO()
|
latex_warnfile = StringIO()
|
||||||
|
|
||||||
|
@ -159,10 +159,9 @@ def with_app(*args, **kwargs):
|
|||||||
@wraps(func)
|
@wraps(func)
|
||||||
def deco(*args2, **kwargs2):
|
def deco(*args2, **kwargs2):
|
||||||
app = TestApp(*args, **kwargs)
|
app = TestApp(*args, **kwargs)
|
||||||
try:
|
func(app, *args2, **kwargs2)
|
||||||
return func(app, *args2, **kwargs2)
|
# don't execute cleanup if test failed
|
||||||
finally:
|
app.cleanup()
|
||||||
app.cleanup()
|
|
||||||
return deco
|
return deco
|
||||||
return generator
|
return generator
|
||||||
|
|
||||||
@ -176,11 +175,10 @@ def gen_with_app(*args, **kwargs):
|
|||||||
@wraps(func)
|
@wraps(func)
|
||||||
def deco(*args2, **kwargs2):
|
def deco(*args2, **kwargs2):
|
||||||
app = TestApp(*args, **kwargs)
|
app = TestApp(*args, **kwargs)
|
||||||
try:
|
for item in func(app, *args2, **kwargs2):
|
||||||
for item in func(app, *args2, **kwargs2):
|
yield item
|
||||||
yield item
|
# don't execute cleanup if test failed
|
||||||
finally:
|
app.cleanup()
|
||||||
app.cleanup()
|
|
||||||
return deco
|
return deco
|
||||||
return generator
|
return generator
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user