Skip to content

Commit bdfaeb2

Browse files
Merge collapsible if statements (#601)
1 parent 4dfb1af commit bdfaeb2

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

numcodecs/tests/test_registry.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,17 @@ def test_all_classes_registered():
2626
2727
see #346 for more info
2828
"""
29-
missing = set()
30-
for _name, submod in inspect.getmembers(numcodecs, inspect.ismodule):
31-
for _name, obj in inspect.getmembers(submod):
32-
if inspect.isclass(obj):
33-
if issubclass(obj, numcodecs.abc.Codec):
34-
if obj.codec_id not in numcodecs.registry.codec_registry:
35-
missing.add(obj.codec_id)
36-
37-
# remove `None``
38-
missing.remove(None)
29+
missing = set(
30+
obj.codec_id
31+
for _, submod in inspect.getmembers(numcodecs, inspect.ismodule)
32+
for _, obj in inspect.getmembers(submod)
33+
if (
34+
inspect.isclass(obj)
35+
and issubclass(obj, numcodecs.abc.Codec)
36+
and obj.codec_id not in numcodecs.registry.codec_registry
37+
and obj.codec_id is not None # remove `None`
38+
)
39+
)
40+
3941
if missing:
4042
raise Exception(f"these codecs are missing: {missing}") # pragma: no cover

0 commit comments

Comments
 (0)