pytest adoption: current status (beginning of May)

Marc Abramowitz msabramo at gmail.com
Wed May 6 17:23:44 EDT 2015


Sounds like mostly a documentation issue to me. I can probably add a few
notes to the docs or answer your questions and then you can update the docs
as you see fit.

> So after spending N minutes running the tests, I have to run them all
again to figure out which one failed?

I think what is usually done in this case is that folks `pip install
pytest-cache` and that adds options for rerunning failed tests. From
https://pypi.python.org/pypi/pytest-cache:

> The plugin provides two options to rerun failures, namely --lf to only
re-run the failures and --ff to run all tests but the failures from the
last run first. For cleanup (usually not needed), a --clearcache option
allows to remove all cross-session cache contents ahead of a test run.

(I believe I saw some chatter about merging those features from
pytest-cache into the pytest core, but I don't recall what the status of
that was.) This I guess needs to be documented if it's something people
want often, because it's not easily discoverable.

The gist of the error you showed is the line:

E               IndexError: Body does not contain string '<span
class="repotag">hg'

Then pytest shows captured output to stdout and stderr. I guess if this is
long, then it could kind of hide the error or make it scroll off the
screen. Perhaps try the -s (--capture=no) option and see if that works for
you better. Some of my favorite options are:

* --pdb,
* --maxfail=1
* -k EXPRESSION
* --tb=short        (I find the default traceback style a bit too much most
of the time)
* -rfEsxX         # show extra test summary info as specified by chars
(f)ailed, (E)error, (s)skipped, (x)failed, (X)passed.

and definitely check out pytest-sugar --
https://github.com/Frozenball/pytest-sugar -- it adds a nice progress bar
and it displays failures instantly as they happen so you can start to
investigate while the test suite is still running.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sfconservancy.org/pipermail/kallithea-general/attachments/20150506/93fca917/attachment-0001.html>


More information about the kallithea-general mailing list