[Python-Dev] Py3k DeprecationWarning in stdlib

Guido van Rossum guido at python.org
Thu Jun 26 17:02:09 CEST 2008

On Thu, Jun 26, 2008 at 6:56 AM, Nick Coghlan <ncoghlan at gmail.com> wrote:
> Andrew Bennetts wrote:
>> Brett Cannon wrote:
>>> On Wed, Jun 25, 2008 at 6:08 AM, Andrew Bennetts
>> [...]
>>>> Should I file a bug for this?
>>> If you want, but Benjamin plans to undocument this for users along
>>> with all other test.support stuff (which I agree with). Most of the
>>> APIs in test.support were just quickly written and have not
>>> necessarily been thought through in order to make sure that the APIs
>>> makes sense (like in this case).
>> Ok, then we're back to there being no supported way to write tests that
>> need to
>> intercept warnings.  Twisted has already suffered from this (JP reports
>> that
>> Twisted's assertWarns is broken in 2.6), and I doubt it's alone.
>> So I guess I am filing a bug after all... :)
> Yeah - Brett's correct that everything under "test.test_support" should
> really be formally undocumented. It's mostly a place for code that reflects
> "things we do a lot in our unit tests and are tired of repeating" rather
> than "this is a good API that we want to support forever and encourage other
> people to use".

I still have a big problem with this attitude. If it's valuable enough
to share between our tests, it should be properly written for reuse
and documented. A collection of hacks remains a collection of hacks.
We can do better.

> However, if other folks turn out to have similar needs, then it may be
> possible to add something to unittest to support it. However, given that the
> beta deadline has already passed, you may need to use similar hackery to
> that used by catch_warning and replace warnings.showwarning with a test
> function that saves the raised exception (it also wouldn't be hard to
> enhance it a bit to handle more than a single warning).

I don't think the beta should be used as an argument to prevent
refactoring and documenting code. I think Andrew's complaint is
justified and should be addressed. I don't expect the test suite to
remain unchanged while we're in beta anyways...

--Guido van Rossum (home page: http://www.python.org/~guido/)

More information about the Python-Dev mailing list