Skip to content

xfail condition should include platform module in namespace #3236

@jaraco

Description

@jaraco

One can currently write:

@pytest.xfail("sys.platform == 'darwin'")

But not

@pytest.xfail("platform.platform() == 'Darwin'")

If one tries that, an error is raised:

Error evaluating 'xfail' expression
    platform.platform() == "Darwin"
NameError: name 'platform' is not defined

It seems reasonable to me the platform module should be exposed in the namespace for these conditional methods for the same reason sys is.

I searched but could not find an existing issue or even a definition of what these conditional expressions are guaranteed to support, so I hope this is not a duplicate report.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueeasy issue that is friendly to new contributorstatus: help wanteddevelopers would like help from experts on this topictopic: marksrelated to marks, either the general marks or builtintype: docsdocumentation improvement, missing or needing clarificationtype: 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