Skip to content

Commit cd558fe

Browse files
committed
refactor: use instance check to print repr
1 parent 5c99913 commit cd558fe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/_pytest/assertion/rewrite.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
from _pytest._version import version
3232
from _pytest.assertion import util
3333
from _pytest.config import Config
34-
from _pytest.fixtures import getfixturemarker
34+
from _pytest.fixtures import FixtureFunctionDefinition
3535
from _pytest.main import Session
3636
from _pytest.pathlib import absolutepath
3737
from _pytest.pathlib import fnmatch_ex
@@ -463,7 +463,7 @@ def _format_assertmsg(obj: object) -> str:
463463

464464
def _should_repr_global_name(obj: object) -> bool:
465465
if callable(obj):
466-
return getfixturemarker(obj) is not None
466+
return isinstance(obj, FixtureFunctionDefinition)
467467

468468
try:
469469
return not hasattr(obj, "__name__")

0 commit comments

Comments
 (0)