Skip to content

not collect deselected tests #239

@pytestbot

Description

@pytestbot

Originally reported by: Anonymous


Some tests can be generating multiple tests through @pytest.mark.parametrize() or metafunc.parametrize, however if those tests are marked and specified not to run (through -m "not marker" command line argument) they are still collected first and then are deselected.

In my specific case, one of @pytest.mark.parametrize() is generating around 500 tests - only to be deselected afterwards. This makes a long test even longer.

Suggestion: to add an option not to generate (or not to collect) tests that are not required.

Thanks!


Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: collectionrelated to the collection phasetopic: selectionrelated to test selection from the command linetype: 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