From d2583247dbdcccb069213e5389e5695237577626 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Fri, 5 Feb 2021 18:36:19 +0100 Subject: Fixing mypy error (Couldn't detect type checking with type, changed to isinstance) --- minishell_test/test/test.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'minishell_test/test') diff --git a/minishell_test/test/test.py b/minishell_test/test/test.py index 7b6a118..ff1f389 100644 --- a/minishell_test/test/test.py +++ b/minishell_test/test/test.py @@ -6,7 +6,7 @@ # By: charles +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2020/06/16 21:48:50 by charles #+# #+# # -# Updated: 2021/02/05 17:39:44 by charles ### ########.fr # +# Updated: 2021/02/05 18:35:12 by charles ### ########.fr # # # # ############################################################################ # @@ -28,11 +28,11 @@ class Test: def __init__( self, cmd: str, - setup: str = "", - files: List[str] = [], - exports: Dict[str, str] = {}, - timeout: float = config.TIMEOUT, - hook: HookType = [], + setup: str = "", + files: List[str] = [], + exports: Dict[str, str] = {}, + timeout: float = config.TIMEOUT, + hook: HookType = [], hook_status: HookStatusType = [], ): """ Test class @@ -50,12 +50,12 @@ class Test: self.exports = exports self.result: Optional[Union[Result, LeakResult]] = None self.timeout = timeout - if type(hook) is not list: - hook = [hook] # type: ignore - if type(hook_status) is not list: - hook_status = [hook_status] # type: ignore - self.hook: List[Callable[[str], str]] = hook # type: ignore - self.hook_status: List[Callable[[int], int]] = hook_status # type: ignore + if not isinstance(hook, list): + hook = [hook] + if not isinstance(hook_status, list): + hook_status = [hook_status] + self.hook = hook + self.hook_status = hook_status def run(self, index: int) -> None: """ Run the test for minishell and the reference shell and print the result out """ -- cgit