Skip to content

Please add option to show failure messages for all reruns  #156

@vyahello

Description

@vyahello

Problem:
pytest-rerunfailures plugin shows only assertion message from the last launched test case. From the code snippet, it is tough to identify what went wrong on the first and second attempts.

~  pytest test_one.py --reruns 2 -v   

test_one.py::test_fail RERUN    [100%]
test_one.py::test_fail RERUN    [100%]
test_one.py::test_fail FAILED   [100%]

================================ FAILURES ==================================
________________________________ test_fail _________________________________

def test_fail():
>       assert False, 'Fake message'
E       AssertionError: Fake message
E       assert False

test_one.py:5: AssertionError

============================== short test summary info ======================
FAILED test_one.py::test_fail - AssertionError: Fake message
================================ 1 failed, 2 rerun in 0.13s =================

It would be extremely useful (especially in debugging) to see all previous assertion messages such as described in the FAILURES section for the last failed test case. For instance, the last assertion message does not mean that all previous tests failed with the same reason.

The solution I would like to see:
I would like to see some extra argument that will allow launching logs for all failed/rerun testcases. As far as I see from the code below failure logging is omitted at all (log=False):

reports = runtestprotocol(item, nextitem=nextitem, log=False)

It would be great if a new argument will allow to manage log parameter so that user will take control on logging failures.

I know that we can extend test summary with -r rR option, but unfortunately, it is not enough.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wanteda pull request to fix this issue is welcome

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions