Skip to content

Commit 5778819

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

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
@@ -1209,11 +1209,12 @@ def __call__(self, *args: Any, **kwds: Any) -> Any:
12091209
fail(message, pytrace=False)
12101210

12111211
def _get_wrapped_function(self) -> Callable[..., Any]:
1212-
if self._instance is not None:
1213-
return cast(
1214-
Callable[..., Any], self._fixture_function.__get__(self._instance)
1215-
)
1216-
return self._fixture_function
1212+
if self._instance is None:
1213+
return self._fixture_function
1214+
1215+
return cast(
1216+
Callable[..., Any], self._fixture_function.__get__(self._instance)
1217+
)
12171218

12181219

12191220
@overload

0 commit comments

Comments
 (0)