aboutsummaryrefslogtreecommitdiff
path: root/src/suite/decorator.py
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2021-02-05 01:38:33 +0100
committerCharles Cabergs <me@cacharle.xyz>2021-02-05 01:38:33 +0100
commita3e983f78dc4cbcf6f75f78fa2b3c57e09cd1b2b (patch)
tree41e580d778fce9baa00dd3850b8cf79b9ac820e9 /src/suite/decorator.py
parente3fd7b2f1de32dfedce03470571f383b407096cb (diff)
downloadminishell_test-a3e983f78dc4cbcf6f75f78fa2b3c57e09cd1b2b.tar.gz
minishell_test-a3e983f78dc4cbcf6f75f78fa2b3c57e09cd1b2b.tar.bz2
minishell_test-a3e983f78dc4cbcf6f75f78fa2b3c57e09cd1b2b.zip
Added a few flake8 plugin
Diffstat (limited to 'src/suite/decorator.py')
-rw-r--r--src/suite/decorator.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/suite/decorator.py b/src/suite/decorator.py
index 87787de..fdc7fb6 100644
--- a/src/suite/decorator.py
+++ b/src/suite/decorator.py
@@ -6,7 +6,7 @@
# By: charles <me@cacharle.xyz> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2020/09/11 12:28:00 by charles #+# #+# #
-# Updated: 2021/01/31 04:45:08 by charles ### ########.fr #
+# Updated: 2021/02/04 16:18:11 by charles ### ########.fr #
# #
# ############################################################################ #
@@ -17,13 +17,16 @@ from suite import Suite
from test import Test
-def suite(groups: List[str] = [], bonus: bool = False):
+def suite(groups: List[str] = [], bonus: bool = False): # type: ignore
"""Decorator generator for suites arguments"""
def suite_wrapper(origin):
"""Decorator for a suite function (fmt: suite_[name]) """
- mod_name = inspect.getmodule(origin).__name__[len("suites."):]
+ mod = inspect.getmodule(origin)
+ if mod is None:
+ raise NotImplementedError
+ mod_name = mod.__name__[len("suites."):]
name = "{}/{}".format(mod_name, origin.__name__[len("suite_"):])
description = origin.__doc__
if description is None: