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 @@ -1188,9 +1188,6 @@ def __init__(
11881188 ):
11891189 self .name = fixture_function_marker .name or function .__name__
11901190 self .__name__ = self .name
1191- # This attribute is used to check if an arbitrary python object is a fixture.
1192- # Using isinstance on every object in code might execute code that is not intended to be executed.
1193- # Like lazy loaded classes.
11941191 self ._fixture_function_marker = fixture_function_marker
11951192 self ._fixture_function = function
11961193 self ._instance = instance
You can’t perform that action at this time.
0 commit comments