diff --git a/src/ert/scheduler/local_driver.py b/src/ert/scheduler/local_driver.py index 6db0bd838f8..a8c7468c487 100644 --- a/src/ert/scheduler/local_driver.py +++ b/src/ert/scheduler/local_driver.py @@ -63,9 +63,9 @@ async def finish(self) -> None: raise result logger.info("All realization tasks finished") - async def _run(self, iens: int, executable: str, /, *args: str) -> None: + async def _run(self, iens: int, executable: str, /, *args: str | Path) -> None: logger.debug( - f"Submitting realization {iens} as command '{executable} {' '.join(args)}'" + f"Submitting realization {iens} as command '{executable} {' '.join(str(arg) for arg in args)}'" ) try: proc = await self._init( diff --git a/tests/ert/unit_tests/scheduler/test_local_driver.py b/tests/ert/unit_tests/scheduler/test_local_driver.py index 473e8e24c76..0aec0f2db95 100644 --- a/tests/ert/unit_tests/scheduler/test_local_driver.py +++ b/tests/ert/unit_tests/scheduler/test_local_driver.py @@ -129,3 +129,15 @@ async def test_that_killing_killed_job_does_not_raise(): await driver.kill(23) await driver.kill(23) assert driver.event_queue.empty() + + +@pytest.mark.timeout(10) +async def test_path_as_argument(tmp_path): + driver = LocalDriver() + os.chdir(tmp_path) + + await driver.submit(42, "/usr/bin/env", "touch", Path(tmp_path) / "testfile") + assert await driver.event_queue.get() == StartedEvent(iens=42) + assert await driver.event_queue.get() == FinishedEvent(iens=42, returncode=0) + + assert Path("testfile").exists()