diff --git a/src/uwtools/drivers/driver.py b/src/uwtools/drivers/driver.py index 35fd3c7d3..bfc6d1d02 100644 --- a/src/uwtools/drivers/driver.py +++ b/src/uwtools/drivers/driver.py @@ -112,7 +112,7 @@ def schema(cls) -> dict: with open(internal_schema_file(schema_name=cls._schema_name()), "r", encoding="utf-8") as f: return bundle(json.load(f)) - def taskname(self, suffix: str) -> str: + def taskname(self, suffix: Optional[str] = None) -> str: """ Return a common tag for task-related log messages. diff --git a/src/uwtools/drivers/make_solo_mosaic.py b/src/uwtools/drivers/make_solo_mosaic.py index d9598edac..86efcadd0 100644 --- a/src/uwtools/drivers/make_solo_mosaic.py +++ b/src/uwtools/drivers/make_solo_mosaic.py @@ -2,6 +2,8 @@ A driver for make_solo_mosaic. """ +from typing import Optional + from iotaa import tasks from uwtools.drivers.driver import DriverTimeInvariant @@ -26,7 +28,7 @@ def provisioned_rundir(self): # Public helper methods - def taskname(self, suffix: str) -> str: + def taskname(self, suffix: Optional[str] = None) -> str: """ Return a common tag for graph-task log messages. diff --git a/src/uwtools/tests/drivers/test_driver.py b/src/uwtools/tests/drivers/test_driver.py index 1553d699d..5b6a66edf 100644 --- a/src/uwtools/tests/drivers/test_driver.py +++ b/src/uwtools/tests/drivers/test_driver.py @@ -233,6 +233,11 @@ def test_Assets_leadtime(config): assert obj.leadtime == leadtime +def test_Assets_taskname(assetsobj): + assert assetsobj.taskname() == "concrete" + assert assetsobj.taskname(suffix="test") == "concrete test" + + def test_Assets_validate(assetsobj, caplog): log.setLevel(logging.INFO) assetsobj.validate() diff --git a/src/uwtools/tests/drivers/test_support.py b/src/uwtools/tests/drivers/test_support.py index 474382db0..8c17171d8 100644 --- a/src/uwtools/tests/drivers/test_support.py +++ b/src/uwtools/tests/drivers/test_support.py @@ -48,7 +48,7 @@ def driver_name(cls): def provisioned_rundir(self): pass - def taskname(self, suffix): + def taskname(self, suffix=None): pass @external