Skip to content

Feature: Don't "skip" this file, "ignore" this file. #3844

@dev351

Description

@dev351

While the pytestmark = pytest.mark.skip in the global scope is useful for skipping all tests in a file, it would be useful to be able to "ignore" the file altogether using a similar global assignment. That is, be able to provide a marker in the test file that will hide the module from discovery in the same manner as --ignore=<test-file> does on the command line.

My motivation here is as follows. pytest.mark.skip emits SKIPPED messages for each test in the file when the -v flag. Whereas, it would also be useful to suppress that output altogether by simply "ignoring" the file.

My enhancement proposal is provide "ignore" behaviour around the follow global syntax (or similar):
pytestmark = pytest.mark.ignore

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: reportingrelated to terminal output and user-facing messages and errorstype: 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