[Python-checkins] r65316 - doctools/branches/0.4.x/tests/test_markup.py
benjamin.peterson
python-checkins at python.org
Thu Jul 31 01:12:08 CEST 2008
Author: benjamin.peterson
Date: Thu Jul 31 01:12:07 2008
New Revision: 65316
Log:
make the app for test_markup global to the module
Modified:
doctools/branches/0.4.x/tests/test_markup.py
Modified: doctools/branches/0.4.x/tests/test_markup.py
==============================================================================
--- doctools/branches/0.4.x/tests/test_markup.py (original)
+++ doctools/branches/0.4.x/tests/test_markup.py Thu Jul 31 01:12:07 2008
@@ -18,9 +18,16 @@
from sphinx.htmlwriter import HTMLWriter, SmartyPantsHTMLTranslator
from sphinx.latexwriter import LaTeXWriter, LaTeXTranslator
-optparser = frontend.OptionParser(components=(rst.Parser, HTMLWriter, LaTeXWriter))
-settings = optparser.get_default_values()
-parser = rst.Parser()
+def setup_module():
+ global app, settings, parser
+ app = TestApp()
+ optparser = frontend.OptionParser(components=(rst.Parser, HTMLWriter, LaTeXWriter))
+ settings = optparser.get_default_values()
+ settings.env = app.builder.env
+ parser = rst.Parser()
+
+def teardown_module():
+ app.cleanup()
# since we're not resolving the markup afterwards, these nodes may remain
class ForgivingTranslator:
@@ -36,9 +43,7 @@
pass
- at with_testapp()
-def verify(app, rst, html_expected, latex_expected):
- settings.env = app.builder.env
+def verify(rst, html_expected, latex_expected):
document = utils.new_document('test data', settings)
parser.parse(rst, document)
for msg in document.traverse(nodes.system_message):
More information about the Python-checkins
mailing list