Skip to content

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

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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