@@ -155,7 +155,7 @@ def getfixturemarker(obj: object) -> Optional["FixtureFunctionMarker"]:
155155 exceptions."""
156156 return cast (
157157 Optional [FixtureFunctionMarker ],
158- safe_getattr (obj , "_pytestfixturefunction " , None ),
158+ safe_getattr (obj , "_fixture_function_marker " , None ),
159159 )
160160
161161
@@ -1193,7 +1193,7 @@ class FixtureFunctionDefinition:
11931193
11941194 def __init__ (
11951195 self ,
1196- function : Callable [..., object ],
1196+ function : Callable [..., Any ],
11971197 fixture_function_marker : FixtureFunctionMarker ,
11981198 instance : Optional [type ] = None ,
11991199 ):
@@ -1202,17 +1202,16 @@ def __init__(
12021202 # This attribute is only used to check if an arbitrary python object is a fixture.
12031203 # Using isinstance on every object in code might execute code that is not intended to be executed.
12041204 # Like lazy loaded classes.
1205- self ._pytestfixturefunction = fixture_function_marker
1206- self .fixture_function_marker = fixture_function_marker
1207- self .fixture_function = function
1208- self .instance = instance
1205+ self ._fixture_function_marker = fixture_function_marker
1206+ self ._fixture_function = function
1207+ self ._instance = instance
12091208
12101209 def __repr__ (self ) -> str :
1211- return f"pytest_fixture({ self .fixture_function } )"
1210+ return f"pytest_fixture({ self ._fixture_function } )"
12121211
12131212 def __get__ (self , instance , owner = None ):
12141213 return FixtureFunctionDefinition (
1215- self .fixture_function , self .fixture_function_marker , instance
1214+ self ._fixture_function , self ._fixture_function_marker , instance
12161215 )
12171216
12181217 def __call__ (self , * args : Any , ** kwds : Any ) -> Any :
@@ -1224,10 +1223,10 @@ def __call__(self, *args: Any, **kwds: Any) -> Any:
12241223 )
12251224 fail (message , pytrace = False )
12261225
1227- def get_real_func (self ):
1228- if self .instance is not None :
1229- return self .fixture_function .__get__ (self .instance )
1230- return self .fixture_function
1226+ def _get_wrapped_function (self ):
1227+ if self ._instance is not None :
1228+ return self ._fixture_function .__get__ (self ._instance )
1229+ return self ._fixture_function
12311230
12321231
12331232@overload
@@ -1769,7 +1768,7 @@ def parsefactories(
17691768 if isinstance (obj , FixtureFunctionDefinition ):
17701769 if marker .name :
17711770 name = marker .name
1772- func = obj .get_real_func ()
1771+ func = obj ._get_wrapped_function ()
17731772 self ._register_fixture (
17741773 name = name ,
17751774 nodeid = nodeid ,
0 commit comments