Skip to content

Commit

Permalink
Add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-janssen committed Feb 19, 2024
1 parent 7fbbfac commit 3cc12e7
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/test_subprocess_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@ def test_execute_single_task(self):
self.assertTrue(f.done())
self.assertEqual("test\n", f.result())

def test_wrong_error(self):
test_queue = queue.Queue()
test_queue.put({"wrong_key": True})
with self.assertRaises(KeyError):
execute_single_task(future_queue=test_queue)

def test_broken_executable(self):
test_queue = queue.Queue()
f = Future()
test_queue.put({"future": f, "args": [["/executable/does/not/exist"]], "kwargs": {"universal_newlines": True}})
with self.assertRaises(FileNotFoundError):
execute_single_task(future_queue=test_queue)

def test_shell_static_executor_args(self):
with SubprocessExecutor(max_workers=1) as exe:
future = exe.submit(["echo", "test"], universal_newlines=True, shell=False)
Expand Down

0 comments on commit 3cc12e7

Please sign in to comment.