Skip to content

Commit bca098b

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

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/_pytest/fixtures.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,11 +1215,12 @@ def __call__(self, *args: Any, **kwds: Any) -> Any:
12151215
fail(message, pytrace=False)
12161216

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

12241225

12251226
@overload

0 commit comments

Comments
 (0)