Skip to content

Commit cac3984

Browse files
committed
WIP
1 parent 5142ee1 commit cac3984

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

src/uwtools/drivers/driver.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -376,10 +376,7 @@ def run(self):
376376
if self.config[STR.execution][STR.executable] is None:
377377
msg = "Drivers not specifying 'executable' must override the run() method"
378378
raise UWNotImplementedError(msg)
379-
if self._batch:
380-
yield self._run_via_batch_submission()
381-
else:
382-
yield self._run_via_local_execution()
379+
yield self._run_via_batch_submission() if self._batch else self._run_via_local_execution()
383380

384381
@task
385382
def runscript(self):

src/uwtools/tests/drivers/test_driver.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,11 +443,12 @@ def test_Driver_output_not_implemented(cls, config, utc):
443443
@mark.parametrize("batch", [True, False])
444444
def test_Driver_run(batch, driverobj, node):
445445
driverobj._batch = batch
446+
executable = Path(driverobj.config["execution"]["executable"])
447+
executable.touch()
446448
with (
447449
patch.object(driverobj, "_run_via_batch_submission", return_value=node) as rvbs,
448450
patch.object(driverobj, "_run_via_local_execution", return_value=node) as rvle,
449451
):
450-
Path(driverobj._config["execution"]["executable"]).touch()
451452
driverobj.run()
452453
if batch:
453454
rvbs.assert_called_once_with()

0 commit comments

Comments
 (0)