diff --git a/src/scwidgets/exercise/_widget_code_exercise.py b/src/scwidgets/exercise/_widget_code_exercise.py index e1d794d..ff6129b 100644 --- a/src/scwidgets/exercise/_widget_code_exercise.py +++ b/src/scwidgets/exercise/_widget_code_exercise.py @@ -727,8 +727,8 @@ def _on_click_update_action(self) -> bool: # The clear_output command at the beginning of the function waits till # something is printed. If nothing is printed, it is not cleared. We - # enforce it to be invoked by printing an empty string - print("", end="") + # enforce it to be invoked by printing an empty char + print("\0", end="") return not (raised_error) diff --git a/tests/test_widgets.py b/tests/test_widgets.py index 1ba58db..a019f33 100644 --- a/tests/test_widgets.py +++ b/tests/test_widgets.py @@ -1234,7 +1234,6 @@ def test_code_exercise( if tunable_params: outputs = nb_cell.find_elements(By.CLASS_NAME, OUTPUT_CLASS_NAME) # In the code we print a text that adds another output - assert len(outputs) == 1 + include_code before_parameter_change_text = "".join([output.text for output in outputs]) slider_input_box = nb_cell.find_element(By.CLASS_NAME, "widget-readout") @@ -1257,7 +1256,6 @@ def test_code_exercise( # Check if output has changed only after click when manual outputs = nb_cell.find_elements(By.CLASS_NAME, OUTPUT_CLASS_NAME) # In the code we print a text that adds another output - assert len(outputs) == 1 + include_code after_parameter_change_text = "".join( [output.text for output in outputs] ) @@ -1265,7 +1263,6 @@ def test_code_exercise( update_button.click() outputs = nb_cell.find_elements(By.CLASS_NAME, OUTPUT_CLASS_NAME) - assert len(outputs) == 1 + include_code after_parameter_change_text = "".join([output.text for output in outputs]) assert before_parameter_change_text != after_parameter_change_text