Skip to content

Should test runs using lastfailed still scan all test files?Β #2187

Open
@DoWhileGeek

Description

@DoWhileGeek

My understanding of --lastfailed is that we want to be quicker than a default run, and only test the failing tests. Right now I'm working on a project with 364 tests, and when I use lastfailed, it appears pytest is still traversing all test files, which seems sub optimal, given we have a cache of filenames and test names.

I've attached a condensed output to stdout for added context:

/src# pytest --last-failed

run-last-failure: rerun last 4 failures
collected 364 items

Metadata

Metadata

Assignees

No one assigned

    Labels

    plugin: cacherelated to the cache builtin plugintype: enhancementnew feature or API change, should be merged into features branch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions