In the Indirect parametrization example I want to type hint request.param indicating a specific type, a str for example.
The problem is since the argument to fixt must be the request fixture there seems to be no way to indicate what type the parameters passed through the "optional param attribute" should be (quoting the documentation).
What are the alternatives? Perhaps documenting the type hint in the fixt docstring, or in the test_indirect docstring?
@pytest.fixture
def fixt(request):
return request.param * 3
@pytest.mark.parametrize("fixt", ["a", "b"], indirect=True)
def test_indirect(fixt):
assert len(fixt) == 3