aboutsummaryrefslogtreecommitdiff
path: root/src/suite
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2021-01-31 04:43:43 +0100
committerCharles Cabergs <me@cacharle.xyz>2021-01-31 04:45:21 +0100
commitc97912223d3730e08a06cffec886c0ff4f3da95c (patch)
treea942eb61d0ece0b75792150ec901161b603555cf /src/suite
parent361e1fe39e88788ef4173083482d520753225a3e (diff)
downloadminishell_test-c97912223d3730e08a06cffec886c0ff4f3da95c.tar.gz
minishell_test-c97912223d3730e08a06cffec886c0ff4f3da95c.tar.bz2
minishell_test-c97912223d3730e08a06cffec886c0ff4f3da95c.zip
Fixing typing error
Diffstat (limited to 'src/suite')
-rw-r--r--src/suite/decorator.py8
-rw-r--r--src/suite/suite.py11
2 files changed, 11 insertions, 8 deletions
diff --git a/src/suite/decorator.py b/src/suite/decorator.py
index e9f9efa..87787de 100644
--- a/src/suite/decorator.py
+++ b/src/suite/decorator.py
@@ -6,16 +6,18 @@
# By: charles <me@cacharle.xyz> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2020/09/11 12:28:00 by charles #+# #+# #
-# Updated: 2021/01/31 02:13:40 by charles ### ########.fr #
+# Updated: 2021/01/31 04:45:08 by charles ### ########.fr #
# #
# ############################################################################ #
+import inspect
+from typing import List
+
from suite import Suite
from test import Test
-import inspect
-def suite(groups: list[str] = [], bonus: bool = False):
+def suite(groups: List[str] = [], bonus: bool = False):
"""Decorator generator for suites arguments"""
def suite_wrapper(origin):
diff --git a/src/suite/suite.py b/src/suite/suite.py
index ef01784..f3d58b1 100644
--- a/src/suite/suite.py
+++ b/src/suite/suite.py
@@ -6,12 +6,12 @@
# By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2020/07/15 18:24:29 by charles #+# #+# #
-# Updated: 2021/01/31 03:31:15 by charles ### ########.fr #
+# Updated: 2021/01/31 04:40:22 by charles ### ########.fr #
# #
# ############################################################################ #
import sys
-from typing import List, Tuple
+from typing import List, Tuple, Optional, Callable
import config
from test import Test
@@ -68,7 +68,8 @@ class Suite:
))
cls.available.sort(key=lambda s: s.name)
for s in cls.available:
- s.generator_func()
+ if s.generator_func is not None:
+ s.generator_func()
@classmethod
def available_names(cls) -> List[str]:
@@ -107,7 +108,7 @@ class Suite:
self.groups = groups
self.description = description
self.bonus = bonus
- self.generator_func = None
+ self.generator_func: Optional[Callable] = None
self.tests: List[Test] = []
def add(self, test):
@@ -133,7 +134,7 @@ class Suite:
if not (config.RANGE[0] <= i <= config.RANGE[1]):
continue
t.run(i)
- if config.EXIT_FIRST and t.result.failed:
+ if config.EXIT_FIRST and t.result is not None and t.result.failed:
return False
if config.VERBOSE_LEVEL == 0:
print()