aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bot/test_constants.py
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2023-04-09 21:15:18 +0100
committerGravatar Chris Lovering <[email protected]>2023-04-11 16:48:14 +0100
commit8dca42846d2956122d45795763095559a6a51b64 (patch)
tree480cd7d3c1a6d6bc87710e2d3c19f223a92f7c5d /tests/bot/test_constants.py
parentReplace CI flake8 config with ruff (diff)
Migrate code style to ruff
Co-authored-by: Boris Muratov <[email protected]> Co-authored-by: wookie184 <[email protected]>
Diffstat (limited to 'tests/bot/test_constants.py')
-rw-r--r--tests/bot/test_constants.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/tests/bot/test_constants.py b/tests/bot/test_constants.py
index f10d6fbe8..3492021ce 100644
--- a/tests/bot/test_constants.py
+++ b/tests/bot/test_constants.py
@@ -23,11 +23,7 @@ def is_annotation_instance(value: typing.Any, annotation: typing.Any) -> bool:
def is_any_instance(value: typing.Any, types: typing.Collection) -> bool:
"""Return True if `value` is an instance of any type in `types`."""
- for type_ in types:
- if is_annotation_instance(value, type_):
- return True
-
- return False
+ return any(is_annotation_instance(value, type_) for type_ in types)
class ConstantsTests(unittest.TestCase):
@@ -39,7 +35,7 @@ class ConstantsTests(unittest.TestCase):
sections = (
cls
for (name, cls) in inspect.getmembers(constants)
- if hasattr(cls, 'section') and isinstance(cls, type)
+ if hasattr(cls, "section") and isinstance(cls, type)
)
for section in sections:
for name, annotation in section.__annotations__.items():