refactor if-statement
This commit is contained in:
parent
e56898029b
commit
8aa6789da9
|
@ -403,8 +403,8 @@ class PyCollector(PyobjMixin, nodes.Collector):
|
||||||
|
|
||||||
def istestfunction(self, obj: object, name: str) -> bool:
|
def istestfunction(self, obj: object, name: str) -> bool:
|
||||||
if self.funcnamefilter(name) or self.isnosetest(obj):
|
if self.funcnamefilter(name) or self.isnosetest(obj):
|
||||||
if isinstance(obj, staticmethod) or isinstance(obj, classmethod):
|
if isinstance(obj, (staticmethod, classmethod)):
|
||||||
# staticmethods need to be unwrapped.
|
# staticmethods and classmethods need to be unwrapped.
|
||||||
obj = safe_getattr(obj, "__func__", False)
|
obj = safe_getattr(obj, "__func__", False)
|
||||||
return callable(obj) and fixtures.getfixturemarker(obj) is None
|
return callable(obj) and fixtures.getfixturemarker(obj) is None
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue