Skip to content

Commit 005c641

Browse files
mattipev-br
authored andcommitted
MAINT: simplify inspect.isdatadescriptors
1 parent 0b8683d commit 005c641

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

scipy_doctest/impl.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -541,17 +541,11 @@ def find(self, obj, name=None, module=None, globs=None, extraglobs=None):
541541
tests = super().find(obj, name, module, globs, extraglobs)
542542

543543
if inspect.isclass(obj):
544-
descriptors = [
545-
(name_, method)
546-
for name_, method in inspect.getmembers(obj)
547-
if inspect.isdatadescriptor(method)
548-
]
549-
550-
for name_, method in descriptors:
551-
tests += super().find(
552-
method, f'{name}.{name_}', module, globs, extraglobs
553-
)
554-
544+
for name_, method in inspect.getmembers(obj):
545+
if inspect.isdatadescriptor(method):
546+
tests += super().find(
547+
method, f'{name}.{name_}', module, globs, extraglobs
548+
)
555549
return tests
556550

557551

0 commit comments

Comments
 (0)