@@ -151,7 +151,6 @@ def __init__(self, shell):
151
151
super ().__init__ (shell )
152
152
self .shell : InteractiveShell = shell
153
153
self .cell : str = ""
154
- self .debug : bool = False
155
154
self .module_file : Optional [pathlib .Path ] = None
156
155
self .module_name : Optional [str ] = None
157
156
self .threaded : Optional [bool ] = None
@@ -271,17 +270,17 @@ def ipytest(self, line: str, cell: str):
271
270
line_contents = set (line .split ())
272
271
273
272
# Debug mode?
274
- if "debug" in line_contents :
273
+ debug = "debug" in line_contents
274
+ if debug :
275
275
line_contents .remove ("debug" )
276
- self .debug = True
277
276
278
277
# Check if we need to run the tests on a separate thread
279
278
if "async" in line_contents :
280
279
line_contents .remove ("async" )
281
280
self .threaded = True
282
281
self .test_queue = Queue ()
283
282
284
- with self .traceback_handling (self . debug ):
283
+ with self .traceback_handling (debug ):
285
284
# Get the module containing the test(s)
286
285
if (
287
286
module_name := get_module_name (
@@ -306,7 +305,7 @@ def ipytest(self, line: str, cell: str):
306
305
results = self .run_cell ()
307
306
308
307
# If in debug mode, display debug information first
309
- if self . debug :
308
+ if debug :
310
309
debug_output = DebugOutput (
311
310
module_name = self .module_name ,
312
311
module_file = self .module_file ,
0 commit comments