From 4a4f6b5b01bd6d23c141d51dd9399c36d12d29d9 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Sun, 31 Jan 2021 02:38:49 +0100 Subject: Fixing some type error, Added travis ci --- src/test/test.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/test/test.py') diff --git a/src/test/test.py b/src/test/test.py index 51389ca..527b435 100644 --- a/src/test/test.py +++ b/src/test/test.py @@ -6,13 +6,14 @@ # By: charles +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2020/06/16 21:48:50 by charles #+# #+# # -# Updated: 2021/01/10 15:20:38 by cacharle ### ########.fr # +# Updated: 2021/01/31 02:21:17 by charles ### ########.fr # # # # ############################################################################ # import os import sys import subprocess +from typing import Optional import config from test.captured import Captured @@ -24,8 +25,8 @@ class Test: def __init__(self, cmd: str, setup: str = "", - files: [str] = [], - exports: {str: str} = {}, + files: list[str] = [], + exports: dict[str, str] = {}, timeout: float = config.TIMEOUT, signal=None, hook=[], @@ -44,7 +45,7 @@ class Test: self.setup = setup self.files = files self.exports = exports - self.result = None + self.result: Optional[Result] = None self.timeout = timeout self.signal = signal self.hook = hook @@ -72,7 +73,7 @@ class Test: self.result = Result(self.full_cmd, self.files, expected, actual) self.result.put(index) - def _run_sandboxed(self, shell_cmd: [str]) -> Captured: + def _run_sandboxed(self, shell_cmd: list[str]) -> Captured: """ Run the command in a sandbox environment """ with sandbox.context(): if self.setup != "": @@ -94,7 +95,7 @@ class Test: sys.exit(1) return self._run_capture(shell_cmd) - def _run_capture(self, shell_cmd: [str]) -> Captured: + def _run_capture(self, shell_cmd: list[str]) -> Captured: """ Capture the output (stdout and stderr) Capture the content of the watched files after the command is run """ -- cgit