@@ -141,7 +141,7 @@ class XCppNotebookTests(unittest.TestCase):
141141 # Add more notebook names as needed
142142 ]
143143
144- def test_notebooks (self ):
144+ def test_notebooks (self ) -> None :
145145 for name in self .notebook_names :
146146
147147 inp = f'Notebooks/{ name } .ipynb'
@@ -167,15 +167,12 @@ def test_notebooks(self):
167167 for i , (input_cell , output_cell ) in enumerate (zip (input_nb .cells , output_nb .cells )):
168168 if input_cell .cell_type == 'code' and output_cell .cell_type == 'code' :
169169 # If one cell has output and the other doesn't, set check to False
170- # if bool(input_cell.outputs) != bool(output_cell.outputs):
171- # self.fail(f"Cell {i} in notebook {name} has mismatched output presence")
172- self .assertEqual (bool (input_cell .outputs ), bool (output_cell .outputs ), f"Cell { i } in notebook { name } has mismatched output presence" )
173- for input_output , output_output in zip (input_cell .outputs , output_cell .outputs ):
174- self .assertEqual (input_output .get ('text' ), output_output .get ('text' ), f"Cell { i } in notebook { name } has mismatched output type" )
175- # else:
176- # for input_output, output_output in zip(input_cell.outputs, output_cell.outputs):
177- # if input_output.get('text') != output_output.get('text'):
178- # self.fail(f"{input_output.get('text')} != {output_output.get('text')} Cell {i} in notebook {name} has mismatched output type")
170+ if bool (input_cell .outputs ) != bool (output_cell .outputs ):
171+ self .fail (f"Cell { i } in notebook { name } has mismatched output presence" )
172+ else :
173+ for input_output , output_output in zip (input_cell .outputs , output_cell .outputs ):
174+ if input_output .get ('text' ) != output_output .get ('text' ):
175+ self .fail (f"{ input_output .get ('text' )} != { output_output .get ('text' )} Cell { i } in notebook { name } has mismatched output type" )
179176
180177
181178class XCppTests2 (jupyter_kernel_test .KernelTests ):
0 commit comments