Fix failing staticmethod tests if they are inherited (#8205)
* Fix failing staticmethod tests if they are inherited * add comments, set default=None
This commit is contained in:
@@ -59,6 +59,20 @@ def test_getfuncargnames_staticmethod():
|
||||
assert getfuncargnames(A.static, cls=A) == ("arg1", "arg2")
|
||||
|
||||
|
||||
def test_getfuncargnames_staticmethod_inherited() -> None:
|
||||
"""Test getfuncargnames for inherited staticmethods (#8061)"""
|
||||
|
||||
class A:
|
||||
@staticmethod
|
||||
def static(arg1, arg2, x=1):
|
||||
raise NotImplementedError()
|
||||
|
||||
class B(A):
|
||||
pass
|
||||
|
||||
assert getfuncargnames(B.static, cls=B) == ("arg1", "arg2")
|
||||
|
||||
|
||||
def test_getfuncargnames_partial():
|
||||
"""Check getfuncargnames for methods defined with functools.partial (#5701)"""
|
||||
import functools
|
||||
|
||||
Reference in New Issue
Block a user