refactor: use instance check to print repr
This commit is contained in:
parent
2a7cdc6c05
commit
289a9d5da8
|
@ -35,7 +35,7 @@ from _pytest._io.saferepr import saferepr
|
|||
from _pytest._version import version
|
||||
from _pytest.assertion import util
|
||||
from _pytest.config import Config
|
||||
from _pytest.fixtures import getfixturemarker
|
||||
from _pytest.fixtures import FixtureFunctionDefinition
|
||||
from _pytest.main import Session
|
||||
from _pytest.pathlib import absolutepath
|
||||
from _pytest.pathlib import fnmatch_ex
|
||||
|
@ -463,7 +463,7 @@ def _format_assertmsg(obj: object) -> str:
|
|||
|
||||
def _should_repr_global_name(obj: object) -> bool:
|
||||
if callable(obj):
|
||||
return getfixturemarker(obj) is not None
|
||||
return isinstance(obj, FixtureFunctionDefinition)
|
||||
|
||||
try:
|
||||
return not hasattr(obj, "__name__")
|
||||
|
|
Loading…
Reference in New Issue