aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGravatar kwzrd <[email protected]>2020-02-02 18:36:36 +0100
committerGravatar kwzrd <[email protected]>2020-02-02 18:36:36 +0100
commit9758e32beba0f88cdb1ee80c2e4bc5539013740e (patch)
tree089683fb834d812371a8d043ecd043a6ef785c43 /tests
parentAdjust existing tests to inherit from RuleTest ABC (diff)
Make RuleTest use ABCMeta
This will prevent child classes to be instantiated unless they implement all abstract methods, leading to a more descriptive error message.
Diffstat (limited to 'tests')
-rw-r--r--tests/bot/rules/__init__.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/bot/rules/__init__.py b/tests/bot/rules/__init__.py
index d7cd7b66b..36c986fe1 100644
--- a/tests/bot/rules/__init__.py
+++ b/tests/bot/rules/__init__.py
@@ -1,5 +1,5 @@
import unittest
-from abc import abstractmethod
+from abc import ABCMeta, abstractmethod
from typing import Callable, Dict, Iterable, List, NamedTuple, Tuple
from tests.helpers import MockMessage
@@ -12,7 +12,7 @@ class DisallowedCase(NamedTuple):
n_violations: int
-class RuleTest(unittest.TestCase):
+class RuleTest(unittest.TestCase, metaclass=ABCMeta):
"""
Abstract class for antispam rule test cases.