Skip to content

Commit

Permalink
test working directory (#530)
Browse files Browse the repository at this point in the history
* test working directory

* Update test_executor_backend_mpi.py
  • Loading branch information
jan-janssen authored Dec 20, 2024
1 parent f1649fa commit e9a81f8
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/test_executor_backend_mpi.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import importlib.util
import shutil
import time
Expand Down Expand Up @@ -110,3 +111,20 @@ def test_meta_executor_parallel_cache(self):
self.assertTrue(fs_2.done())
time_4 = time.time()
self.assertTrue(time_3 - time_4 < 1)


class TestWorkingDirectory(unittest.TestCase):
def test_output_files_cwd(self):
dirname = os.path.abspath(os.path.dirname(__file__))
os.makedirs(dirname, exist_ok=True)
with Executor(
max_cores=1,
resource_dict={"cores": 1, "cwd": dirname},
backend="local",
block_allocation=True,
) as p:
output = p.map(calc, [1, 2, 3])
self.assertEqual(
list(output),
[1, 2, 3],
)

0 comments on commit e9a81f8

Please sign in to comment.