[issue11887] unittest fails on comparing str with bytes if python has the -bb option

STINNER Victor report at bugs.python.org
Mon May 2 10:26:10 CEST 2011


STINNER Victor <victor.stinner at haypocalc.com> added the comment:

Le lundi 02 mai 2011 07:05:28, vous avez écrit :
>   * the patch introduces code/complexity in _baseAssertEqual and other
> places, using catch_warnings to change and restore the warning filters at
> every call;

Yes, and what is the problem? I think that it is cheap: it copies a list, 
prepends an item to a short list, and then copies a reference (the previous 
list).

I think that the patch is simple (it adds 3 "with+simplefilter") and it 
doesn't add "complexity", or you should define what complexity is :-)

> * this is needed only when Python is run with -b/-bb and that
> is quite uncommon (afaik);

Buildbots use "make buildbottest" which run python with -bb (which is a good 
idea!). So all buildbots already use -bb since long time.

I forgot the explain the usecase: I don't remember correctly, but a test 
failed on a buildbot, and I was unable to get more information because 
unittest "failed" too.

> * even if this is not fixed, a test suite that
> passes all the tests without -b/-bb will most likely pass with -b/-bb[0];

No. You have usually more failures with -bb than without any -b flag. Not in 
the test itself, but in a function called by the test.

> * if there are failing tests with -b/-bb, it's usually possible to remove
> the -b/-bb and fix them before re-adding -bb[1];

A test may only fail with -bb.

Anyway, my problem is to be able to get more informations on a failure in a 
buildbot. I cannot change (easily) -bb flags on the buildbots (and I don't 
want to do that). When something goes wrong on a buildbot, in some cases it is 
very hard to reproduce the failure on my own computer. I want as much 
information as possible.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11887>
_______________________________________


More information about the Python-bugs-list mailing list