From de429f33191b84bc261535d8deba54399fb1bd4a Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Tue, 10 Jul 2007 22:39:57 -0400 Subject: 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. --- Mailman/testing/test_documentation.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'Mailman/testing/test_documentation.py') 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 -- cgit v1.2.3-70-g09d2