Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#6024 closed (fixed)

Django's doctest clashes with coverage.py

Reported by: marcink Owned by: nobody
Component: Testing framework Version: dev
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When you use coverage.py in "manage.py test" it incorrectly reports
some statements as not executed. This is a known issue with
coverage.py. From http://nedbatchelder.com/code/modules/coverage.html
:

"Older versions of doctest interfere with coverage's tracing of
statements, and you may get reports that none of your code is
executing. Use this patch to doctest.py if you are experiencing
problems."

I checked, the patch from Zope does help. The attached file
contains the patch as applied to django.test._doctest.

Attachments (2)

doctest_patch_for_coverage_py.diff (816 bytes ) - added by marcink 17 years ago.
doctest_patch_for_coverage_py-r6777.diff (1.0 KB ) - added by Todd O'Bryan 17 years ago.

Download all attachments as: .zip

Change History (6)

by marcink, 17 years ago

by Todd O'Bryan, 17 years ago

comment:1 by Todd O'Bryan, 17 years ago

The previous patch doesn't apply cleanly to the current trunk.

comment:2 by Simon G <dev@…>, 17 years ago

Triage Stage: UnreviewedReady for checkin

comment:3 by Jacob, 17 years ago

Resolution: fixed
Status: newclosed

(In [6851]) Fixed #6024: Django's doctest no longer clashes with coverage.py. Thanks to Ned Batchelder for the original fix, and Todd O'Brian for his update to make it work with Django.

comment:4 by Todd O'Bryan, 17 years ago

Ahem, that's O'Bryan with a "y". :-)

Note: See TracTickets for help on using tickets.
Back to Top