diff options
| author | Eugene Triguba <eugenetriguba@gmail.com> | 2023-04-08 13:32:54 -0400 |
|---|---|---|
| committer | Eugene Triguba <eugenetriguba@gmail.com> | 2023-04-08 13:32:54 -0400 |
| commit | cb15068997415dc587add40784c930557fbfac82 (patch) | |
| tree | 10021678e13fe62f18311cc7f239eb076511a4b8 /tests/test_taskipy.py | |
| parent | gh-32: Fix usage of sys.argv to ignore executable (diff) | |
| download | taskipy2-cb15068997415dc587add40784c930557fbfac82.zip | |
gh-32: Fix linting warnings/failures
Diffstat (limited to 'tests/test_taskipy.py')
| -rw-r--r-- | tests/test_taskipy.py | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/tests/test_taskipy.py b/tests/test_taskipy.py index 4b9b347..9cf680a 100644 --- a/tests/test_taskipy.py +++ b/tests/test_taskipy.py @@ -6,7 +6,7 @@ import time import unittest import warnings from os import path -from typing import List, Tuple +from typing import List, Optional, Tuple from parameterized import parameterized # type: ignore import psutil # type: ignore @@ -26,12 +26,23 @@ class TaskipyTestCase(unittest.TestCase): for tmp_dir in self._tmp_dirs: tmp_dir.clean() - def run_task(self, task: str, args: List[str] = None, cwd=os.curdir) -> Tuple[int, str, str]: + def run_task( + self, + task: str, + args: Optional[List[str]] = None, + cwd=os.curdir, + ) -> Tuple[int, str, str]: + args = args or [] proc = self.start_taskipy_process(task, args=args, cwd=cwd) stdout, stderr = proc.communicate() return proc.returncode, stdout.decode(), str(stderr) - def start_taskipy_process(self, task: str, args: List[str] = None, cwd=os.curdir) -> subprocess.Popen: + def start_taskipy_process( + self, + task: str, + args: Optional[List[str]] = None, + cwd=os.curdir, + ) -> subprocess.Popen: executable_path = path.abspath('task') args = args or [] return subprocess.Popen([executable_path, task] + args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=cwd) |