From e54574c56d310d52b32c3c7d938bf379ee58e99a Mon Sep 17 00:00:00 2001 From: CamDavidsonPilon Date: Sat, 16 Sep 2023 11:24:04 -0400 Subject: [PATCH] fix test --- pioreactor/actions/leader/experiment_profile.py | 10 ++++++++-- pioreactor/automations/__init__.py | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/pioreactor/actions/leader/experiment_profile.py b/pioreactor/actions/leader/experiment_profile.py index 4d008cdc..5a6814ca 100644 --- a/pioreactor/actions/leader/experiment_profile.py +++ b/pioreactor/actions/leader/experiment_profile.py @@ -133,7 +133,9 @@ def load_and_verify_profile_file(profile_filename: str) -> struct.Profile: # 1. def check_for_not_stopping_automations(act): if act.type == "stop": - raise ValueError("Don't use 'stop' for automations. Use 'stop' for controllers.") + raise ValueError( + "Don't use 'stop' for automations. To stop automations, use 'stop' for controllers." + ) return True for automation_type in ["temperature_automation", "dosing_automation", "led_automation"]: @@ -207,7 +209,11 @@ def execute_experiment_profile(profile_filename: str, dry_run: bool = False) -> action_name = "experiment_profile" logger = create_logger(action_name) with publish_ready_to_disconnected_state(unit, experiment, action_name) as state: - profile = load_and_verify_profile_file(profile_filename) + try: + profile = load_and_verify_profile_file(profile_filename) + except Exception as e: + logger.error(e) + raise e publish( f"pioreactor/{unit}/{experiment}/{action_name}/experiment_profile_name", diff --git a/pioreactor/automations/__init__.py b/pioreactor/automations/__init__.py index 8a64fe90..cb5f958b 100644 --- a/pioreactor/automations/__init__.py +++ b/pioreactor/automations/__init__.py @@ -36,4 +36,4 @@ def execute(self) -> Optional[events.AutomationEvent]: """ Overwrite in subclass """ - return None + return events.NoEvent()