summaryrefslogtreecommitdiff
path: root/Mailman/testing/test_documentation.py
diff options
context:
space:
mode:
authorBarry Warsaw2007-07-10 22:39:57 -0400
committerBarry Warsaw2007-07-10 22:39:57 -0400
commitde429f33191b84bc261535d8deba54399fb1bd4a (patch)
tree1d1f2b932c33f70deb34ee68c802bbd3ee2cb8df /Mailman/testing/test_documentation.py
parentbebaec0e24f3492ff4190c36074b6c51cd44589b (diff)
downloadmailman-de429f33191b84bc261535d8deba54399fb1bd4a.tar.gz
mailman-de429f33191b84bc261535d8deba54399fb1bd4a.tar.zst
mailman-de429f33191b84bc261535d8deba54399fb1bd4a.zip
Conversion of the ToDigest tests to doctests, along with just enough handler
module update to make the thing pass. Much more coverage is still necessary, but this at least recreates the existing tests. Changes to the test infrastructure to make REPORT_ONLY_FIRST_FAILURE conditional on lower (default) verbosity. Increase the verbosity via 'bin/testall -v' and you get all the failure output.
Diffstat (limited to 'Mailman/testing/test_documentation.py')
-rw-r--r--Mailman/testing/test_documentation.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/Mailman/testing/test_documentation.py b/Mailman/testing/test_documentation.py
index 23641d57b..c5fb62302 100644
--- a/Mailman/testing/test_documentation.py
+++ b/Mailman/testing/test_documentation.py
@@ -60,15 +60,19 @@ def cleaning_teardown(testobj):
def test_suite():
suite = unittest.TestSuite()
docsdir = os.path.join(os.path.dirname(Mailman.__file__), 'docs')
+ # Under higher verbosity settings, report all doctest errors, not just the
+ # first one.
+ flags = (doctest.ELLIPSIS |
+ doctest.NORMALIZE_WHITESPACE |
+ doctest.REPORT_NDIFF)
+ if config.opts.verbosity <= 2:
+ flags |= doctest.REPORT_ONLY_FIRST_FAILURE
for filename in os.listdir(docsdir):
if os.path.splitext(filename)[1] == '.txt':
test = doctest.DocFileSuite(
'docs/' + filename,
package=Mailman,
- optionflags=(doctest.ELLIPSIS
- | doctest.NORMALIZE_WHITESPACE
- | doctest.REPORT_NDIFF
- | doctest.REPORT_ONLY_FIRST_FAILURE),
+ optionflags=flags,
tearDown=cleaning_teardown)
suite.addTest(test)
return suite