Skip to content

Needless message printed with --failed-first and no failed tests #3853

@nedbat

Description

@nedbat

--failed-first always means, run all the tests, but order the recent failure to run first. But if there were no failures, it always prints a message that it is going to run all the tests. This message is not needed.

$ cat test_it.py
def test_it():
    assert 1 == 1

$ pytest
================== test session starts ===================
platform darwin -- Python 2.7.14, pytest-3.7.1, py-1.5.4, pluggy-0.7.1
rootdir: /private/tmp/failedfirst, inifile:
plugins: xdist-1.22.5, forked-0.2
collected 1 item

test_it.py .                                                                                                                                                               [100%]

================ 1 passed in 0.01 seconds ================

$ pytest --failed-first
================== test session starts ===================
platform darwin -- Python 2.7.14, pytest-3.7.1, py-1.5.4, pluggy-0.7.1
rootdir: /private/tmp/failedfirst, inifile:
plugins: xdist-1.22.5, forked-0.2
collected 1 item
run-last-failure: run all (no recorded failures)

test_it.py .                                                                                                                                                               [100%]

================ 1 passed in 0.01 seconds ================

$ pytest -q --failed-first
run-last-failure: run all (no recorded failures)
.                                                                                                                                                                          [100%]
1 passed in 0.01 seconds

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueeasy issue that is friendly to new contributortype: proposalproposal for a new feature, often to gather opinions or design the API around the new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions