[Python-Dev] Re-enable warnings in regrtest and/or unittest

Brett Cannon brett at python.org
Mon Nov 22 20:24:34 CET 2010


On Mon, Nov 22, 2010 at 10:58, Ezio Melotti <ezio.melotti at gmail.com> wrote:
> On 22/11/2010 19.45, Michael Foord wrote:
>>
>> On 22/11/2010 17:35, Łukasz Langa wrote:
>>>
>>> Am 22.11.2010 18:14, schrieb Ezio Melotti:
>>>>
>>>> I would like to re-enable by default warnings for regrtest and/or
>>>> unittest.
>>>
>>> +1
>>>
>>> Especially in regrtest it could help manage stdlib quality (currently we
>>> have a horde of ResourceWarnings, zipfile mostly). I would even be +1 on
>>> making warnings errors for regrtest but that seems to be unpopular on
>>> #python-dev.
>>>
>
> As I said on IRC I think it makes sense to turn them into errors once we
> fixed/silenced all the ones that we have now. That would help keeping the
> number of warning to 0.

I agree.

>
>>
>> Enabling it for regrtest makes sense. For unittest I still think it is a
>> choice that should be left to developers.
>
> If we consider that most of the developers want to see them, I'd prefer to
> have the warnings by default rather than having to use -Wd explicitly every
> time I run the tests (keep in mind that many developers out there don't even
> know/remember that now they should use -Wd).

The problem with that is it means developers who switch to Python 3.2
or whatever are suddenly going to have their tests fail until they
update their code to turn the warnings off. Then again, if we make the
switch for this dead simple to add and backwards-compatible so that
turning them off doesn't trigger an error in older versions then I am
all for turning warnings on by default.

Another approach is to have unittest's runner, when run in verbose
mode, print out what the warnings filter is set to so developers are
aware that they are silencing warnings.

-Brett

>
>
>>
>> Michael
>>
>>> Best regards,
>>> Łukasz Langa
>>> _______________________________________________
>>> Python-Dev mailing list
>>> Python-Dev at python.org
>>> http://mail.python.org/mailman/listinfo/python-dev
>>> Unsubscribe:
>>> http://mail.python.org/mailman/options/python-dev/fuzzyman%40voidspace.org.uk
>>
>>
>
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe:
> http://mail.python.org/mailman/options/python-dev/brett%40python.org
>


More information about the Python-Dev mailing list