This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author exarkun
Recipients exarkun
Date 2008-09-04.21:59:44
SpamBayes Score 1.2213695e-06
Marked as misclassified No
Message-id <1220565587.27.0.0684560509319.issue3780@psf.upfronthosting.co.za>
In-reply-to
Content
In Python 2.5 and earlier, the `warnings.warn_explicit` function could
be replaced in order to test what warnings were emitted by some code. 
This allowed unit tests for warnings to be written.  Since much of the
warnings module was re-implemented in C, replacing
`warnings.warn_explicit` no longer has any effect.  This, together with
the fact that there are no other public APIs for hooking into the
warning system with duplication suppression disabled means that there is
no reliable way to write unit tests for warnings.

This was previously discussed on python-dev, but no conclusion was
reached.  See
http://mail.python.org/pipermail/python-dev/2008-June/080635.html and
the follow-ups.

For Twisted, the consequence of this is roughly 79 failing unit tests in
Python 2.6b3 and no clear way to fix them, except to stop using the
standard library warnings module.
History
Date User Action Args
2008-09-04 21:59:47exarkunsetrecipients: + exarkun
2008-09-04 21:59:47exarkunsetmessageid: <1220565587.27.0.0684560509319.issue3780@psf.upfronthosting.co.za>
2008-09-04 21:59:46exarkunlinkissue3780 messages
2008-09-04 21:59:44exarkuncreate