Skip to content

Commit a961889

Browse files
committed
chore: Make FixtureFuction type alias instead of TypeVar
1 parent fc54e35 commit a961889

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

changelog/14399.misc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Made ``FixtureFunction`` a type alias instead of a type var, as it only ever appears once in any function signature.

src/_pytest/fixtures.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@
8282

8383
# The value of the fixture -- return/yield of the fixture function (type variable).
8484
FixtureValue = TypeVar("FixtureValue", covariant=True)
85-
# The type of the fixture function (type variable).
86-
FixtureFunction = TypeVar("FixtureFunction", bound=Callable[..., object])
85+
# The type of the fixture function (type alias).
86+
FixtureFunction = Callable[..., object]
8787
# The type of a fixture function (type alias generic in fixture value).
8888
_FixtureFunc = Callable[..., FixtureValue] | Callable[..., Generator[FixtureValue]]
8989
# The type of FixtureDef.cached_result (type alias generic in fixture value).

0 commit comments

Comments
 (0)