Skip to content

error: "FixtureRequest" has no attribute "param" #9514

Closed
@nipunn1313

Description

@nipunn1313

Based on the instructions here
https://docs.pytest.org/en/6.2.x/fixture.html#parametrizing-fixtures

I believe that FixtureRequest.param is an optional param. It appears to exist at runtime. However, if I try
to access it, mypy gives an error

error: "FixtureRequest" has no attribute "param"

Using mypy 0.931
Using pytest 6.2.5

Can repro with

@pytest.fixture(params=["a", "b"])
def myfixture(request: pytest.FixtureRequest) -> str:
    return request.param

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions