[Python-checkins] r65699 - in doctools/branches/0.4.x/tests: test_build.py test_config.py util.py

benjamin.peterson python-checkins at python.org
Fri Aug 15 23:02:22 CEST 2008


Author: benjamin.peterson
Date: Fri Aug 15 23:02:22 2008
New Revision: 65699

Log:
rename util.with_testapp to util.with_app; nose was running it 

also make an assert more informative


Modified:
   doctools/branches/0.4.x/tests/test_build.py
   doctools/branches/0.4.x/tests/test_config.py
   doctools/branches/0.4.x/tests/util.py

Modified: doctools/branches/0.4.x/tests/test_build.py
==============================================================================
--- doctools/branches/0.4.x/tests/test_build.py	(original)
+++ doctools/branches/0.4.x/tests/test_build.py	Fri Aug 15 23:02:22 2008
@@ -65,7 +65,7 @@
             return name
 
 
- at with_testapp(buildername='html', warning=html_warnfile)
+ at with_app(buildername='html', warning=html_warnfile)
 def test_html(app):
     app.builder.build_all()
     html_warnings = html_warnfile.getvalue().replace(os.sep, '/')
@@ -94,7 +94,7 @@
                                'path %s in %s' % (text, path, fname))
 
 
- at with_testapp(buildername='latex', warning=latex_warnfile)
+ at with_app(buildername='latex', warning=latex_warnfile)
 def test_latex(app):
     LaTeXTranslator.ignore_missing_images = True
     app.builder.build_all()
@@ -124,14 +124,14 @@
 
 # just let the remaining ones run for now
 
- at with_testapp(buildername='linkcheck')
+ at with_app(buildername='linkcheck')
 def test_linkcheck(app):
     app.builder.build_all()
 
- at with_testapp(buildername='text')
+ at with_app(buildername='text')
 def test_text(app):
     app.builder.build_all()
 
- at with_testapp(buildername='changes', cleanenv=True)
+ at with_app(buildername='changes', cleanenv=True)
 def test_changes(app):
     app.builder.build_all()

Modified: doctools/branches/0.4.x/tests/test_config.py
==============================================================================
--- doctools/branches/0.4.x/tests/test_config.py	(original)
+++ doctools/branches/0.4.x/tests/test_config.py	Fri Aug 15 23:02:22 2008
@@ -15,7 +15,7 @@
 from sphinx.application import ExtensionError
 
 
- at with_testapp(confoverrides={'master_doc': 'master', 'nonexisting_value': 'True'})
+ at with_app(confoverrides={'master_doc': 'master', 'nonexisting_value': 'True'})
 def test_core_config(app):
     cfg = app.config
 
@@ -61,7 +61,7 @@
     assert cfg['project'] == cfg.project == 'Sphinx Tests'
 
 
- at with_testapp()
+ at with_app()
 def test_extension_values(app):
     cfg = app.config
 

Modified: doctools/branches/0.4.x/tests/util.py
==============================================================================
--- doctools/branches/0.4.x/tests/util.py	(original)
+++ doctools/branches/0.4.x/tests/util.py	Fri Aug 15 23:02:22 2008
@@ -25,7 +25,7 @@
 __all__ = [
     'test_root',
     'raises', 'raises_msg',
-    'ListOutput', 'TestApp', 'with_testapp',
+    'ListOutput', 'TestApp', 'with_app',
     'path', 'with_tempdir', 'write_file',
     'sprint',
 ]
@@ -60,7 +60,7 @@
     try:
         func(*args, **kwds)
     except exc, err:
-        assert msg in str(err)
+        assert msg in str(err), "\"%s\" not in \"%s\"" % (msg, err)
     else:
         raise AssertionError('%s did not raise %s' %
                              (func.__name__, _excstr(exc)))
@@ -135,7 +135,7 @@
             shutil.rmtree(tree, True)
 
 
-def with_testapp(*args, **kwargs):
+def with_app(*args, **kwargs):
     """
     Make a TestApp with args and kwargs, pass it to the test and clean up
     properly.


More information about the Python-checkins mailing list