aboutsummaryrefslogtreecommitdiffstats
path: root/tests/pydis_core/utils
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2023-05-06 20:09:19 +0100
committerGravatar Chris Lovering <[email protected]>2023-05-31 13:03:54 +0100
commited602405df8e4ddf9e7993e42eea9a5e9afd4856 (patch)
tree3c2284b9d1ef15fa423875be832207b2a06ca291 /tests/pydis_core/utils
parentBump action step versions in CI (diff)
Apply fixes for ruff linting
Diffstat (limited to 'tests/pydis_core/utils')
-rw-r--r--tests/pydis_core/utils/test_regex.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/pydis_core/utils/test_regex.py b/tests/pydis_core/utils/test_regex.py
index 01a2412b..1cf90711 100644
--- a/tests/pydis_core/utils/test_regex.py
+++ b/tests/pydis_core/utils/test_regex.py
@@ -1,10 +1,9 @@
import unittest
-from typing import Optional
from pydis_core.utils.regex import DISCORD_INVITE
-def match_regex(s: str) -> Optional[str]:
+def match_regex(s: str) -> str | None:
"""Helper function to run re.match on a string.
Return the invite capture group, if the string matches the pattern
@@ -14,7 +13,7 @@ def match_regex(s: str) -> Optional[str]:
return result if result is None else result.group("invite")
-def search_regex(s: str) -> Optional[str]:
+def search_regex(s: str) -> str | None:
"""Helper function to run re.search on a string.
Return the invite capture group, if the string matches the pattern