2323)
2424from executorch .backends .test .harness .stages import StageType
2525
26-
2726input_t1 = Tuple [torch .Tensor ] # Input x
2827
2928
@@ -261,14 +260,14 @@ def test_dump_tosa_debug_tosa(test_data: input_t1):
261260
262261
263262@common .parametrize ("test_data" , Linear .inputs )
264- def test_dump_tosa_ops (caplog , test_data : input_t1 ):
263+ def test_dump_tosa_ops (capsys , test_data : input_t1 ):
265264 aten_ops : list [str ] = []
266265 exir_ops : list [str ] = []
267266 pipeline = TosaPipelineINT [input_t1 ](Linear (), test_data , aten_ops , exir_ops )
268267 pipeline .pop_stage ("run_method_and_compare_outputs" )
269268 pipeline .dump_operator_distribution ("to_edge_transform_and_lower" )
270269 pipeline .run ()
271- assert "TOSA operators:" in caplog . text
270+ assert "TOSA operators:" in capsys . readouterr (). out
272271
273272
274273class Add (torch .nn .Module ):
@@ -282,12 +281,15 @@ def forward(self, x):
282281
283282@common .parametrize ("test_data" , Add .inputs )
284283@common .XfailIfNoCorstone300
285- def test_fail_dump_tosa_ops (caplog , test_data : input_t1 ):
284+ def test_fail_dump_tosa_ops (capsys , test_data : input_t1 ):
286285 aten_ops : list [str ] = []
287286 exir_ops : list [str ] = []
288287 pipeline = EthosU55PipelineINT [input_t1 ](
289288 Add (), test_data , aten_ops , exir_ops , use_to_edge_transform_and_lower = True
290289 )
291290 pipeline .dump_operator_distribution ("to_edge_transform_and_lower" )
292291 pipeline .run ()
293- assert "Can not get operator distribution for Vela command stream." in caplog .text
292+ assert (
293+ "Can not get operator distribution for Vela command stream."
294+ in capsys .readouterr ().out
295+ )
0 commit comments