From 3372ca9d6880f684f6865a3e34e1317d3796ac2f Mon Sep 17 00:00:00 2001 From: Matthew Crymble Date: Fri, 20 May 2022 12:22:07 -0500 Subject: tests: streaming: use assert instead of pytest.fail for underruns/overruns When an assert statement fails, pytest will determine whether that should be a fail or an xfail. By explicitly calling pytest.fail, we were preventing pytest from doing that determination, so an individual test case that had an xfail mark would have been a hard failure. --- host/tests/pytests/test_streaming.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'host/tests') diff --git a/host/tests/pytests/test_streaming.py b/host/tests/pytests/test_streaming.py index f0bb6f1d2..553e7608f 100644 --- a/host/tests/pytests/test_streaming.py +++ b/host/tests/pytests/test_streaming.py @@ -306,7 +306,7 @@ def test_streaming(pytestconfig, dut_type, use_dpdk, dual_SFP, rate, rx_rate, rx if not use_dpdk: pytest.xfail(overrun_error_text) else: - pytest.fail(overrun_error_text) + assert False, overrun_error_text if tx_channels: assert stats.avg_vals.tx_timeouts <= tx_timeouts_threshold, \ @@ -326,7 +326,7 @@ def test_streaming(pytestconfig, dut_type, use_dpdk, dual_SFP, rate, rx_rate, rx if not use_dpdk: pytest.xfail(underrun_error_text) else: - pytest.fail(underrun_error_text) + assert False, underrun_error_text assert stats.avg_vals.late_cmds <= late_cmds_threshold, \ f"""Number of late commands exceeded threshold. -- cgit v1.2.3