Skip to content

Commit c3c803f

Browse files
Glyphackwebknjaz
andcommitted
Update src/_pytest/fixtures.py
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]>
1 parent bfbe177 commit c3c803f

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/_pytest/fixtures.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -1216,11 +1216,12 @@ def __call__(self, *args: Any, **kwds: Any) -> Any:
12161216
fail(message, pytrace=False)
12171217

12181218
def _get_wrapped_function(self) -> Callable[..., Any]:
1219-
if self._instance is not None:
1220-
return cast(
1221-
Callable[..., Any], self._fixture_function.__get__(self._instance)
1222-
)
1223-
return self._fixture_function
1219+
if self._instance is None:
1220+
return self._fixture_function
1221+
1222+
return cast(
1223+
Callable[..., Any], self._fixture_function.__get__(self._instance)
1224+
)
12241225

12251226

12261227
@overload

0 commit comments

Comments
 (0)