File tree Expand file tree Collapse file tree 2 files changed +2
-4
lines changed Expand file tree Collapse file tree 2 files changed +2
-4
lines changed Original file line number Diff line number Diff line change 3131from _pytest ._version import version
3232from _pytest .assertion import util
3333from _pytest .config import Config
34+ from _pytest .fixtures import getfixturemarker
3435from _pytest .main import Session
3536from _pytest .pathlib import absolutepath
3637from _pytest .pathlib import fnmatch_ex
@@ -462,7 +463,7 @@ def _format_assertmsg(obj: object) -> str:
462463
463464def _should_repr_global_name (obj : object ) -> bool :
464465 if callable (obj ):
465- return hasattr (obj , "_fixture_function_marker" )
466+ return getfixturemarker (obj ) is not None
466467
467468 try :
468469 return not hasattr (obj , "__name__" )
Original file line number Diff line number Diff line change @@ -1194,9 +1194,6 @@ def __init__(
11941194 ):
11951195 self .name = fixture_function_marker .name or function .__name__
11961196 self .__name__ = self .name
1197- # This attribute is used to check if an arbitrary python object is a fixture.
1198- # Using isinstance on every object in code might execute code that is not intended to be executed.
1199- # Like lazy loaded classes.
12001197 self ._fixture_function_marker = fixture_function_marker
12011198 self ._fixture_function = function
12021199 self ._instance = instance
You can’t perform that action at this time.
0 commit comments