[TIP] pytest-sugar -> pytest

Stefan Scherfke stefan at sofa-rockers.org
Wed Sep 19 11:22:08 PDT 2018

Am 2018-09-19 um 14:17 schrieb Bruno Oliveira <nicoddemus at gmail.com>:
> Hi Stefan,
> On Wed, Sep 19, 2018 at 7:25 AM Stefan Scherfke <stefan at sofa-rockers.org> wrote:
> Then about about these incremental changes?
> 1. It should not be to hard to change the order in which a test’s name,
>    the test’s output and the test result are printed?
>    The current default is not too readable:
>     tests/test_stuff.py::test_xy has this test PASSED OR FAILED PASSED
>    In the example above, its quite hard to see that "has this test
>    PASSED OR FAILED" is the tests output and not pytest-output.
>    We could copy pytest-sugar's formatting to make it more readable:
>     has this test PASSED OR FAILED
>      tests/test_suff.py::test_xy PASSED
> What do you mean by "the test’s output"? You probably don't mean things like print() and such as those are captured and shown at the end of the run.

That’s exactly what I mean. :-)

This is only relevant, if you invoke pytest with "--capture=no --vv", 
though (e.g., in a CI pipeline).

> 3. We could also show the progress in verbose mode.
> We currently show the progress (percentage or count) in verbose mode. Do you mean a progress bar?

No, the progress in percentage would be okay.  When I last tried it, 
I only got progress with non-verbose mode but not with "-vv".  Dunno, 
have to check it again.  If you’ve got the percentage, a progress bar
doesn’t add to much additional benefit, IMHO.

> Those are all plausible ideas, feel free to create issues to them in the tracker. Furthermore, some of them, specially 4, are really simple and candidates for a PR. :)

I will see what I can do. :-)


More information about the testing-in-python mailing list