We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 15e2be0 commit 55b1803Copy full SHA for 55b1803
1 file changed
tests/core_tests/test_plugin_hooks.py
@@ -2,7 +2,7 @@
2
Validates all hook registrations in all plugins
3
"""
4
import importlib
5
-import string
+import re
6
from numbers import Number
7
from pathlib import Path
8
@@ -16,6 +16,7 @@
16
database.metadata = MetaData()
17
Hook.original_init = Hook.__init__
18
19
+DOC_RE = re.compile(r"^(?:(?:<.+?>|{.+?}|\[.+?\]).+?)*?-\s.+$")
20
PLUGINS = []
21
22
@@ -106,7 +107,7 @@ def test_hook_kwargs(hook):
106
107
108
def test_hook_doc(hook):
109
if hook.type == "command" and hook.doc:
- assert hook.doc[:1] not in "." + string.ascii_letters, \
110
+ assert DOC_RE.match(hook.doc), \
111
"Invalid docstring '{}' format for command hook".format(hook.doc)
112
113
0 commit comments