diff --git a/cylc/flow/workflow_events.py b/cylc/flow/workflow_events.py index 2b99ef3d2c..704d604d2c 100644 --- a/cylc/flow/workflow_events.py +++ b/cylc/flow/workflow_events.py @@ -235,7 +235,7 @@ def get_events_conf( glbl_cfg().get(['scheduler', 'mail']) ): value = getter.get(key) - if value is not None and value != []: + if value is not None: return value return default diff --git a/tests/unit/test_workflow_events.py b/tests/unit/test_workflow_events.py index 89449953f2..3aabc6de06 100644 --- a/tests/unit/test_workflow_events.py +++ b/tests/unit/test_workflow_events.py @@ -34,6 +34,9 @@ ('handlers', True, True, ['stall']), ('handlers', False, True, None), ('handlers', False, False, None), + ('mail events', True, True, []), + ('mail events', False, True, ['abort']), + ('mail events', False, False, None), ('from', True, True, 'docklands@railway'), ('from', False, True, 'highway@mixture'), ('from', False, False, None), @@ -55,13 +58,14 @@ def test_get_events_handler( from = highway@mixture [[events]] abort on workflow timeout = True + mail events = abort ''' ) config = SimpleNamespace() config.cfg = { 'scheduler': { - 'events': {'handlers': ['stall']}, + 'events': {'handlers': ['stall'], 'mail events': []}, 'mail': {'from': 'docklands@railway'}, } if workflow_cfg else {'events': {}} }