aboutsummaryrefslogtreecommitdiff
path: root/src/suite/decorator.py
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-10-08 08:43:12 +0200
committerCharles Cabergs <me@cacharle.xyz>2020-10-08 08:43:12 +0200
commitc20cbfea9bb878fc88e76f0ba773ded5a7b149ca (patch)
treea49139c7f4a85cfab07df1d41be15a0275010fe6 /src/suite/decorator.py
parent0cf5d76836a6499de4e30c4066d8709099ff6331 (diff)
downloadminishell_test-c20cbfea9bb878fc88e76f0ba773ded5a7b149ca.tar.gz
minishell_test-c20cbfea9bb878fc88e76f0ba773ded5a7b149ca.tar.bz2
minishell_test-c20cbfea9bb878fc88e76f0ba773ded5a7b149ca.zip
Added suite description for -l option
Diffstat (limited to 'src/suite/decorator.py')
-rw-r--r--src/suite/decorator.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/suite/decorator.py b/src/suite/decorator.py
index d4801c3..12f58a6 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: 2020/09/11 22:08:36 by charles ### ########.fr #
+# Updated: 2020/10/08 08:34:10 by cacharle ### ########.fr #
# #
# ############################################################################ #
@@ -22,10 +22,15 @@ def suite(groups: [str] = [], bonus: bool = False):
"""Decorator for a suite function (fmt: suite_[name]) """
mod_name = inspect.getmodule(origin).__name__[len("suites."):]
- # print(mod_name)
-
name = "{}/{}".format(mod_name, origin.__name__[len("suite_"):])
- s = Suite(name, groups + [mod_name], bonus)
+ description = origin.__doc__
+ if description is None:
+ print("You should had a doc string to the {} suite".format(name))
+ description = "no description"
+ description = description.split("\n")[0].strip()
+
+ s = Suite(name, groups + [mod_name], bonus, description)
+
def test_generator():
def test(*args, **kwargs):