[Checkins] SVN: zope.testing/trunk/ The option REPORT_ONLY_FIRST_FAILURE (command line option "-1") is now respected even when a doctest declares its own REPORTING_FLAGS, such as REPORT_NDIFF.

Wolfgang Schnerring wosc at wosc.de
Fri May 29 08:28:12 EDT 2009


Log message for revision 100531:
  The option REPORT_ONLY_FIRST_FAILURE (command line option "-1") is now respected even when a doctest declares its own REPORTING_FLAGS, such as REPORT_NDIFF.
  

Changed:
  U   zope.testing/trunk/CHANGES.txt
  U   zope.testing/trunk/src/zope/testing/doctest.py
  U   zope.testing/trunk/src/zope/testing/testrunner/testrunner-ex/sample2/sampletests_1.py

-=-
Modified: zope.testing/trunk/CHANGES.txt
===================================================================
--- zope.testing/trunk/CHANGES.txt	2009-05-29 08:04:37 UTC (rev 100530)
+++ zope.testing/trunk/CHANGES.txt	2009-05-29 12:28:12 UTC (rev 100531)
@@ -5,6 +5,9 @@
 ==================
 
 - Fix bug when running subprocesses on Windows
+- The option REPORT_ONLY_FIRST_FAILURE (command line option "-1") is now
+  respected even when a doctest declares its own REPORTING_FLAGS, such as
+  REPORT_NDIFF.
 
 
 3.7.4 (2009-05-01)

Modified: zope.testing/trunk/src/zope/testing/doctest.py
===================================================================
--- zope.testing/trunk/src/zope/testing/doctest.py	2009-05-29 08:04:37 UTC (rev 100530)
+++ zope.testing/trunk/src/zope/testing/doctest.py	2009-05-29 12:28:12 UTC (rev 100531)
@@ -2309,6 +2309,9 @@
             # so add the default reporting flags
             optionflags |= _unittest_reportflags
 
+        if _unittest_reportflags & REPORT_ONLY_FIRST_FAILURE:
+            optionflags |= REPORT_ONLY_FIRST_FAILURE
+
         runner = DocTestRunner(optionflags=optionflags,
                                checker=self._dt_checker, verbose=False)
         def write(value):

Modified: zope.testing/trunk/src/zope/testing/testrunner/testrunner-ex/sample2/sampletests_1.py
===================================================================
--- zope.testing/trunk/src/zope/testing/testrunner/testrunner-ex/sample2/sampletests_1.py	2009-05-29 08:04:37 UTC (rev 100530)
+++ zope.testing/trunk/src/zope/testing/testrunner/testrunner-ex/sample2/sampletests_1.py	2009-05-29 12:28:12 UTC (rev 100531)
@@ -26,4 +26,4 @@
     """
         
 def test_suite():
-    return doctest.DocTestSuite()
+    return doctest.DocTestSuite(optionflags=doctest.REPORT_NDIFF)



More information about the Checkins mailing list