diff --git a/src/scwidgets/check/_check.py b/src/scwidgets/check/_check.py index d509906..2212e3d 100644 --- a/src/scwidgets/check/_check.py +++ b/src/scwidgets/check/_check.py @@ -148,11 +148,11 @@ def __init__( self._stop_on_assert_error_raised = stop_on_assert_error_raised @property - def function_to_check(self): + def function_to_check(self) -> Callable[..., FunOutParamsT]: return self._function_to_check @function_to_check.setter - def function_to_check(self, function_to_check): + def function_to_check(self, function_to_check: Callable[..., FunOutParamsT]): self._function_to_check = function_to_check @property diff --git a/src/scwidgets/exercise/_widget_code_exercise.py b/src/scwidgets/exercise/_widget_code_exercise.py index 654db5c..4825513 100644 --- a/src/scwidgets/exercise/_widget_code_exercise.py +++ b/src/scwidgets/exercise/_widget_code_exercise.py @@ -687,7 +687,7 @@ def outputs(self) -> List[CueOutput]: def _on_click_update_action(self) -> bool: self._output.clear_output(wait=True) - self._raised_error = False + raised_error = False # runs code and displays output with self._output: try: @@ -708,10 +708,10 @@ def _on_click_update_action(self) -> bool: cue_output.draw_display() except CodeValidationError as e: - self._raised_error = True + raised_error = True raise e except Exception as e: - self._raised_error = True + raised_error = True raise e # The clear_output command at the beginning of the function waits till @@ -719,7 +719,7 @@ def _on_click_update_action(self) -> bool: # enforce it to be invoked by printing an empty string print("", end="") - return not (self._raised_error) + return not (raised_error) def run_update(self): """ diff --git a/tests/test_code.py b/tests/test_code.py index 890e5ec..1b28465 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -270,7 +270,7 @@ def print_success(code_ex: CodeExercise | None): parameters={"parameter": fixed(5)}, exercise_registry=exercise_registry, exercise_key="test_save_registry_ex", - cue_outputs=[cue_output], + outputs=[cue_output], update_func=print_success, )