aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2020-03-09 14:31:56 -0700
committerGravatar MarkKoz <[email protected]>2020-03-13 17:11:05 -0700
commit1b4def2c8c0d82fc9738c1e969404e305c91cac9 (patch)
treec9b376e28dd3810b795d5a88aefd94b99cf14344 /tests
parentCog tests: add a function to yield all commands (diff)
Cog tests: fix Cog type check in `walk_cogs`
Diffstat (limited to 'tests')
-rw-r--r--tests/bot/cogs/test_cogs.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/bot/cogs/test_cogs.py b/tests/bot/cogs/test_cogs.py
index d260b46a7..75aa1dbf6 100644
--- a/tests/bot/cogs/test_cogs.py
+++ b/tests/bot/cogs/test_cogs.py
@@ -32,9 +32,9 @@ class CommandNameTests(unittest.TestCase):
@staticmethod
def walk_cogs(extension: ModuleType) -> t.Iterator[commands.Cog]:
"""Yield all cogs defined in an extension."""
- for name, cls in extension.__dict__.items():
- if isinstance(cls, commands.Cog):
- yield getattr(extension, name)
+ for obj in extension.__dict__.values():
+ if isinstance(obj, type) and issubclass(obj, commands.Cog):
+ yield obj
@staticmethod
def get_qualified_names(command: commands.Command) -> t.List[str]: