Skip to content

Commit

Permalink
Fix show standards check for Python-only modules
Browse files Browse the repository at this point in the history
  • Loading branch information
benmwebb committed Jan 30, 2024
1 parent 7ce1d36 commit 4b8dc31
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions modules/test/pyext/src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,12 @@ def assertFunctionNames(self, module, exceptions, words):
def assertShow(self, modulename, exceptions):
"""Check that all the classes in modulename have a show method"""
all = dir(modulename)
if hasattr(modulename, '_raii_types'):
excludes = frozenset(
modulename._raii_types + modulename._plural_types)
else:
# Python-only modules don't have these two lists
excludes = frozenset()
not_found = []
for f in all:
# Exclude SWIG C global variables object
Expand All @@ -659,8 +665,7 @@ def assertShow(self, modulename, exceptions):
and f not in exceptions\
and not f.endswith("Temp") and not f.endswith("Iterator")\
and not f.endswith("Exception") and\
f not in modulename._raii_types and \
f not in modulename._plural_types:
f not in excludes:
if not hasattr(getattr(modulename, f), 'show'):
not_found.append(f)
self.assertEqual(
Expand Down

0 comments on commit 4b8dc31

Please sign in to comment.