aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEugene Triguba <eugenetriguba@gmail.com>2023-05-09 21:10:21 -0400
committerGitHub <noreply@github.com>2023-05-09 21:10:21 -0400
commitc71631e9835700175ee14aef53f80899aa88d568 (patch)
treebc8c5f9987b47d63bbc37a6cbe7889d15047ada8 /tests
parentFix CI Badge in Readme (diff)
parentRemove extra comment (diff)
downloadtaskipy2-c71631e9835700175ee14aef53f80899aa88d568.zip
Merge pull request #60 from taskipy/feature/gh-32/add-poetry-plugin
GH-32: Rework `main` for poetry plugin
Diffstat (limited to 'tests')
-rw-r--r--tests/test_taskipy.py17
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)