Skip to content

Ignore individual tests #3198

Closed
Closed
@uSpike

Description

@uSpike

It would be useful for my workflow to be able to ignore specific tests while still collecting an entire directory.

For example, I have:

tests/
    test_a.py # contains test_foo(), test_bar()
    test_b.py # contains test_baz(), test_buz()

I can currently use --ignore to ignore an entire file, but not a specific test. If I want to run every test except for test_a.py::test_foo I will have a very long command line.

I propose to accept test ids with --ignore:

$ pytest tests --ignore tests/test_a.py::test_foo
$ pytest tests --ignore tests/test_a.py::test_foo[param]

Thoughts? I'd be glad to submit a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: enhancementnew feature or API change, should be merged into features branchtype: 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