[Python-projects] logilab-common test issues

Adrien Di Mascio Adrien.DiMascio at logilab.fr
Wed Mar 7 13:08:23 CET 2007


Hi,

[Marien Zwart]

> Trying to get logilab-common-0.21.2 to pass its tests using the
> "pytest" runner I ran into a few problems (other than the fact it's
> not exiting with a nonzero status on failure, which I have hacked
> around for now):

This is fixed in our repostiory.

> Because of the place option parsing happens pytest relies on there
> being exactly one directory called "test" or "tests" somewhere below
> the current directory. The "pytest" main script walks down from the
> current directory and calls testlib.main on every directory called
> test or tests it finds. This main function then (re)parses the
> arguments and runs the tests. This is especially annoying for --help
> (which does nothing if there is no test or tests dir below the current
> one) or -t (specify testdir explicitly, which does nothing if there is
> no test or tests dir below the current one and runs the tests more
> than once if there is more than one).

This is fixed here. You should now be able to use pytest like this:

 $ pytest testfile.py
 $ pytest -t testdir/
 $ pytest
 
> fileutils.abspath_listdir has a doctest that relies on /home
> containing exactly the directories "adim", "alf", "arthur" and "auc".
> I'm guessing this should either not be picked up as a doctest or not
> rely on those directories being there (and no others).

Fixed here too.


> For some reason I have not been able to determine the unittest_testlib
> output capture tests fail if I run pytest with the output redirected
> to a file. I get (reformatted and with the long strings of "---"
> shortened a bit for linewrapping):

[...]

> The first bar of "---"s was not shortened by me. I'm assuming this is
> buffered output but I have not been able to make it go away (I tried
> adding a flush() to FDCapture before it dups the fd but that did not
> seem to fix it). The other output capturing tests fail in a similar
> way if this one is skipped.

The new version doesn't seem to have this problem, but I admit I did
not investigate a lot on this.

A new 0.21.4 version of logilab-common including the mentioned fixes 
should be available before friday.

Thanks again for the reports.

Cheers,
-- 
Adrien Di Mascio                                LOGILAB, Paris (France).
Formations Python,Zope,Debian,Calcul    http://www.logilab.fr/formations
Développement logiciel sur mesure:      http://www.logilab.fr/services
Informatique scientifique:              http://www.logilab.fr/science
Python in Python:     http://codespeak.net/pypy/dist/pypy/doc/index.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.logilab.org/pipermail/python-projects/attachments/20070307/851f3114/attachment.pgp 


More information about the Python-Projects mailing list