test.py -1 does not work on some doctests

Bug #98305 reported by Marius Gedminas
2
Affects Status Importance Assigned to Milestone
Zope 3
Fix Released
Medium
Unassigned
3.4
Won't Fix
Medium
Unassigned
zope.testing
Fix Released
Low
Unassigned

Bug Description

It appears that the -1 option of the test runner fails to affect doctests that explicitly specify one of the REPORT_xxx flags in the DocTestSuite constructor.

Steps to reproduce:

  1. edit src/zope/schema/fields.txt and replace "class IInventoryItem" with "class IInventoryItym" to cause a failure.

  2. edit src/zope/schema/tests/test_docs.py and make sure one of the suites returned by test_suite is defined as follows:

         doctest.DocFileSuite('../fields.txt', optionflags=doctest.REPORT_NDIFF),

  3. run ./test.py -1 -s zope.schema -u

I see three failed doctest sections (on lines 50, 52 and 54).

If I remove REPORT_NDIFF from test_docs.py and repeat step 3, I see only the first failed doctest section.

Revision history for this message
Stephan Richter (srichter) wrote :

Changes: submitter email, importance (medium => critical)

Revision history for this message
Baiju Muthukadan (baijum) wrote :

I am not sure whether this info is usefull or not, but if I replace `from zope.testing import doctest`
with `import doctest`, -1 option is always fails to affect doctests.

Revision history for this message
Christian Theune (ctheune) wrote :

Another bug also suggested that we should never use the global doctest module but Zope's own version. There are only a few uses left of those so replacing them should be fairly straigt forward. (it also related to specifying the repetition parameter as -2)

Revision history for this message
Baiju Muthukadan (baijum) wrote :

Python's built-in doctest module ignore reporting flags in some cases, see: http://www.python.org/doc/2.4.4/lib/doctest-unittest-api.html
  "If any reporting flags were specified when the DocTestCase instance was constructed,
   doctest's unittest reporting flags are ignored."

If zope.testing.doctest also ignore reporting flags like this, this issue can be closed.

Revision history for this message
Christian Theune (ctheune) wrote :

I don't think this is critical but merely inconvenient.

Changed in zope3:
importance: Critical → Medium
status: Unconfirmed → Confirmed
Revision history for this message
Marius Gedminas (mgedmin) wrote :

I believe 'Critical' in the old collector was used for 'should be fixed before next release'.

It certainly isn't a show stopper, just a feature that doesn't work as advertised.

Changed in zope.testing:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Wolfgang Schnerring (wosc) wrote :

this has been fixed in r100531 and released in zope.testing-3.7.5

Changed in zope.testing:
status: Confirmed → Fix Released
Revision history for this message
Christian Theune (ctheune) wrote :

Zope 3.4 uses zope.testing 3.5 which is quite a few major releases back. I don't see the patch will be ported there.

Revision history for this message
Christian Theune (ctheune) wrote :

As it was released in zope.testing we consider it released for Zope 3 in general as well.

Changed in zope3:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.