1919import inflection
2020from typing_extensions import ParamSpec , TypeAlias
2121
22- from .compat import PostGenerationContext
22+ from .compat import PostGenerationContext , PytestFixtureT
2323from .fixturegen import create_fixture
2424
2525if TYPE_CHECKING :
@@ -136,7 +136,7 @@ def generate_fixtures(
136136 factory_name : str ,
137137 overrides : Mapping [str , Any ],
138138 caller_locals : Box [Mapping [str , Any ]],
139- ) -> Iterable [tuple [str , Callable [..., Any ]]]:
139+ ) -> Iterable [tuple [str , Callable [..., object ]]]:
140140 """Generate all the FixtureDefs for the given factory class."""
141141
142142 related : list [str ] = []
@@ -176,10 +176,10 @@ def generate_fixtures(
176176
177177def create_fixture_with_related (
178178 name : str ,
179- function : Callable [P , T ],
179+ function : Callable [..., object ],
180180 fixtures : Collection [str ] | None = None ,
181181 related : Collection [str ] | None = None ,
182- ) -> Callable [ P , T ] :
182+ ) -> PytestFixtureT :
183183 if related is None :
184184 related = []
185185 fixture , fn = create_fixture (name = name , function = function , fixtures = fixtures )
@@ -195,7 +195,7 @@ def make_declaration_fixturedef(
195195 value : Any ,
196196 factory_class : FactoryType ,
197197 related : list [str ],
198- ) -> Callable [..., Any ]:
198+ ) -> Callable [..., object ]:
199199 """Create the FixtureDef for a factory declaration."""
200200 if isinstance (value , (factory .SubFactory , factory .RelatedFactory )):
201201 subfactory_class = value .get_factory ()
0 commit comments