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:
@@ -30,6 +30,10 @@ from sphinx.builders.latex import LaTeXBuilder
|
||||
from sphinx.writers.latex import LaTeXTranslator
|
||||
|
||||
|
||||
def teardown_module():
|
||||
(test_root / '_build').rmtree()
|
||||
|
||||
|
||||
html_warnfile = StringIO()
|
||||
latex_warnfile = StringIO()
|
||||
|
||||
|
||||
@@ -159,10 +159,9 @@ def with_app(*args, **kwargs):
|
||||
@wraps(func)
|
||||
def deco(*args2, **kwargs2):
|
||||
app = TestApp(*args, **kwargs)
|
||||
try:
|
||||
return func(app, *args2, **kwargs2)
|
||||
finally:
|
||||
app.cleanup()
|
||||
func(app, *args2, **kwargs2)
|
||||
# don't execute cleanup if test failed
|
||||
app.cleanup()
|
||||
return deco
|
||||
return generator
|
||||
|
||||
@@ -176,11 +175,10 @@ def gen_with_app(*args, **kwargs):
|
||||
@wraps(func)
|
||||
def deco(*args2, **kwargs2):
|
||||
app = TestApp(*args, **kwargs)
|
||||
try:
|
||||
for item in func(app, *args2, **kwargs2):
|
||||
yield item
|
||||
finally:
|
||||
app.cleanup()
|
||||
for item in func(app, *args2, **kwargs2):
|
||||
yield item
|
||||
# don't execute cleanup if test failed
|
||||
app.cleanup()
|
||||
return deco
|
||||
return generator
|
||||
|
||||
|
||||
Reference in New Issue
Block a user