<div dir="ltr"><div class="gmail_extra"><span style="font-size:12.8000001907349px">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.</span><span class="im" style="font-size:12.8000001907349px"><div><br></div><div>> <span style="font-size:12.8000001907349px">So after spending N minutes running the tests, I have to run them all again to figure out which one failed?</span></div><div><span style="font-size:12.8000001907349px"><br></span></div></span><div style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">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 <a href="https://pypi.python.org/pypi/pytest-cache" target="_blank">https://pypi.python.org/pypi/pytest-cache</a>:</span></div><div style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px"><br></span></div><div style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">> 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.</span></div><div style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px"><br></span></div><div style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">(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.</span></div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px">The gist of the error you showed is the line:</div><span class="im" style="font-size:12.8000001907349px"><div><br></div><div><span style="font-size:12.8000001907349px">E               IndexError: Body does not contain string '<span class="repotag">hg'</span><br></div><div><span style="font-size:12.8000001907349px"><br></span></div></span><div style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">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:</span></div><div style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px"><br></span></div><div style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">* --pdb, </span></div><div style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">* --maxfail=1</span></div><div style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">* -k EXPRESSION</span></div><div style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">* --tb=short        (I find the default traceback style a bit too much most of the time)</span></div><div style><span style="font-size:12.8000001907349px">* -rfEsxX         # show extra test summary info as specified by chars (f)ailed, (E)error, (s)skipped, (x)failed, (X)passed.</span></div><div style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px"><br></span></div><div style><span style="font-size:12.8000001907349px">and definitely check out pytest-sugar -- <a href="https://github.com/Frozenball/pytest-sugar">https://github.com/Frozenball/pytest-sugar</a> -- 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.</span></div></div></div>