Django

Code

Ticket #6024 (closed: fixed)

Opened 1 year ago

Last modified 1 year ago

Django's doctest clashes with coverage.py

Reported by: marcink Assigned to: nobody
Milestone: Component: Testing framework
Version: SVN Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

doctest_patch_for_coverage_py.diff (0.8 kB) - added by marcink on 11/24/07 03:55:19.
doctest_patch_for_coverage_py-r6777.diff (1.0 kB) - added by toddobryan on 11/30/07 07:24:28.

Change History

11/24/07 03:55:19 changed by marcink

  • attachment doctest_patch_for_coverage_py.diff added.

11/30/07 07:24:28 changed by toddobryan

  • attachment doctest_patch_for_coverage_py-r6777.diff added.

11/30/07 07:25:33 changed by toddobryan

  • needs_better_patch changed.
  • needs_tests changed.
  • needs_docs changed.

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

12/01/07 19:29:46 changed by Simon G <dev@simon.net.nz>

  • stage changed from Unreviewed to Ready for checkin.

12/02/07 15:03:54 changed by jacob

  • status changed from new to closed.
  • resolution set to fixed.

(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.

12/02/07 21:57:46 changed by toddobryan

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


Add/Change #6024 (Django's doctest clashes with coverage.py)




Change Properties
Action