File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -1101,17 +1101,18 @@ def resolve_fixture_function(
1101
1101
# The fixture function needs to be bound to the actual
1102
1102
# request.instance so that code working with "fixturedef" behaves
1103
1103
# as expected.
1104
- if request .instance is not None :
1104
+ instance = request .instance
1105
+ if instance is not None :
1105
1106
# Handle the case where fixture is defined not in a test class, but some other class
1106
1107
# (for example a plugin class with a fixture), see #2270.
1107
1108
if hasattr (fixturefunc , "__self__" ) and not isinstance (
1108
- request . instance ,
1109
+ instance ,
1109
1110
fixturefunc .__self__ .__class__ , # type: ignore[union-attr]
1110
1111
):
1111
1112
return fixturefunc
1112
1113
fixturefunc = getimfunc (fixturedef .func )
1113
1114
if fixturefunc != fixturedef .func :
1114
- fixturefunc = fixturefunc .__get__ (request . instance ) # type: ignore[union-attr]
1115
+ fixturefunc = fixturefunc .__get__ (instance ) # type: ignore[union-attr]
1115
1116
return fixturefunc
1116
1117
1117
1118
You can’t perform that action at this time.
0 commit comments