Skip to content

Outdated doc regarding skipping test functions at module level #4206

@keithly

Description

@keithly

Under https://docs.pytest.org/en/latest/skipping.html#skipping-test-functions there's a snippet that demonstrates skipping at the module level.

import pytest

if not pytest.config.getoption("--custom-flag"):
    pytest.skip("--custom-flag is missing, skipping tests", allow_module_level=True)

It seems like pytest.config no longer exists or isn't accessible in this way. This doc should be updated to reflect the current way this would be achieved, or removed if it's not possible. I'm using pytest 3.9.1 but this may have changed in an earlier version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: docsdocumentation improvement, missing or needing clarification

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions