Skip to content

Commit 0bf451b

Browse files
committed
add comments, set default=None
1 parent b29e295 commit 0bf451b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/_pytest/compat.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,12 @@ def getfuncargnames(
162162
# it's passed as an unbound method or function, remove the first
163163
# parameter name.
164164
if is_method or (
165-
cls and not isinstance(inspect.getattr_static(cls, name), staticmethod)
165+
# Not using `getattr` because we don't want to resolve the staticmethod.
166+
# Not using `cls.__dict__` because we want to check the entire MRO.
167+
cls
168+
and not isinstance(
169+
inspect.getattr_static(cls, name, default=None), staticmethod
170+
)
166171
):
167172
arg_names = arg_names[1:]
168173
# Remove any names that will be replaced with mocks.

0 commit comments

Comments
 (0)