Issues

Issue #364 resolved

shorter traceback style by default

faassen avatarfaassen created an issue

The default traceback style of py.test is very informative, but it tends to be rather hard to see what tests exactly failed; lots of scrolling is required. I keep forgetting how to go to a short traceback style in the heat of the moment, too.

A shorter traceback style by default would be cool. Alternatively perhaps a compact summary of failing tests could be displayed at the bottom of the long style.

Comments (9)

  1. holger krekel

    I guess your memory could enhance if you encounter the problem often enough :)

    More seriously, i ponder a new default that would show tracebacks like this:

    • shortened frame source for test function
    • number of ommitted frames
    • shortened frame source for failing function

    "Shortened frame source" means that if len(sourcelines)>=6 or so, it would be collapsed to show the function declaration with in-flowing arguments, omit N lines and then show the last three lines up to the frame position.

    Instead of just printing the number of omitted frames in between, we could also show one line with the filename/linenumber for each ommitted frame.

    makes sense?

  2. holger krekel

    Dusty Phillips pytest-curses would make sense, and i'd help from the core side.

    Stefan Scherfke not sure about the mockup -- the code needs some tweaking anyway to make new reporting possible and it's probably easiest to come up with a working version that people can test in practise before nailing it.

  3. Robert Buchholz

    I have to agree the default layout is much too verbose. It is helpful to see the framed view for debugging, but when working on the tests, finding out what like failed is usually good enough. After all, I just wrote the test! And often times, when a change breaks many tests, having pages to scroll back through makes no sense.

    I'm running pytest in -qq --tb=short mode, which I find a good setting. Unfortunately, --looponfail still creates a lot of noise.

  4. holger krekel

    fix issue364: shorten and enhance tracebacks representation by default. The new "--tb=auto" option (default) will only display long tracebacks for the first and last entry. You can get the old behaviour of printing all entries as long entries with "--tb=long". Also short entries by default are now printed very similarly to "--tb=native" ones.

    → <<cset 011b6de727bc>>

  5. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.