diff --git a/tutorial/tests/testsuite/testsuite.py b/tutorial/tests/testsuite/testsuite.py index 17bdcfa7..2bb8398f 100644 --- a/tutorial/tests/testsuite/testsuite.py +++ b/tutorial/tests/testsuite/testsuite.py @@ -151,7 +151,6 @@ def __init__(self, shell): super().__init__(shell) self.shell: InteractiveShell = shell self.cell: str = "" - self.debug: bool = False self.module_file: Optional[pathlib.Path] = None self.module_name: Optional[str] = None self.threaded: Optional[bool] = None @@ -271,9 +270,9 @@ def ipytest(self, line: str, cell: str): line_contents = set(line.split()) # Debug mode? - if "debug" in line_contents: + debug = "debug" in line_contents + if debug: line_contents.remove("debug") - self.debug = True # Check if we need to run the tests on a separate thread if "async" in line_contents: @@ -281,7 +280,7 @@ def ipytest(self, line: str, cell: str): self.threaded = True self.test_queue = Queue() - with self.traceback_handling(self.debug): + with self.traceback_handling(debug): # Get the module containing the test(s) if ( module_name := get_module_name( @@ -306,7 +305,7 @@ def ipytest(self, line: str, cell: str): results = self.run_cell() # If in debug mode, display debug information first - if self.debug: + if debug: debug_output = DebugOutput( module_name=self.module_name, module_file=self.module_file,