From 85e9462f2ad62ebe765f84ec54b0df094e2994c4 Mon Sep 17 00:00:00 2001 From: Karl W Schulz Date: Tue, 27 Feb 2024 11:32:24 -0600 Subject: [PATCH] apply formatting pass Signed-off-by: Karl W Schulz --- tests/test_analyze_workloads.py | 285 ++++++++++++++++++++++++-------- 1 file changed, 216 insertions(+), 69 deletions(-) diff --git a/tests/test_analyze_workloads.py b/tests/test_analyze_workloads.py index 3d326f501..eed1b5136 100644 --- a/tests/test_analyze_workloads.py +++ b/tests/test_analyze_workloads.py @@ -23,209 +23,356 @@ def test_device_inv_int_MI100(): with pytest.raises(SystemExit) as e: - with patch('sys.argv', ['omniperf', 'analyze', '--path', 'tests/workloads/device_inv_int/MI100']): + with patch( + "sys.argv", + ["omniperf", "analyze", "--path", "tests/workloads/device_inv_int/MI100"], + ): omniperf.main() - assert (e.value.code == 0) + assert e.value.code == 0 + def test_dispatch_0_1_MI100(): with pytest.raises(SystemExit) as e: - with patch('sys.argv', ['omniperf', 'analyze', '--path', 'tests/workloads/dispatch_0_1/MI100']): + with patch( + "sys.argv", + ["omniperf", "analyze", "--path", "tests/workloads/dispatch_0_1/MI100"], + ): omniperf.main() - assert (e.value.code == 0) + assert e.value.code == 0 + def test_dispatch_0_MI100(): with pytest.raises(SystemExit) as e: - with patch('sys.argv', ['omniperf', 'analyze', '--path', 'tests/workloads/dispatch_0/MI100']): + with patch( + "sys.argv", + ["omniperf", "analyze", "--path", "tests/workloads/dispatch_0/MI100"], + ): omniperf.main() - assert (e.value.code == 0) + assert e.value.code == 0 + def test_dispatch_2_MI100(): with pytest.raises(SystemExit) as e: - with patch('sys.argv', ['omniperf', 'analyze', '--path', 'tests/workloads/dispatch_2/MI100']): + with patch( + "sys.argv", + ["omniperf", "analyze", "--path", "tests/workloads/dispatch_2/MI100"], + ): omniperf.main() - assert (e.value.code == 0) + assert e.value.code == 0 + def test_dispatch_6_8_MI100(): with pytest.raises(SystemExit) as e: - with patch('sys.argv', ['omniperf', 'analyze', '--path', 'tests/workloads/dispatch_6_8/MI100']): + with patch( + "sys.argv", + ["omniperf", "analyze", "--path", "tests/workloads/dispatch_6_8/MI100"], + ): omniperf.main() - assert (e.value.code == 1) + assert e.value.code == 1 + def test_dispatch_7_MI100(): with pytest.raises(SystemExit) as e: - with patch('sys.argv', ['omniperf', 'analyze', '--path', 'tests/workloads/dispatch_7/MI100']): + with patch( + "sys.argv", + ["omniperf", "analyze", "--path", "tests/workloads/dispatch_7/MI100"], + ): omniperf.main() - assert (e.value.code == 1) + assert e.value.code == 1 + def test_dispatch_invalid_MI100(): with pytest.raises(SystemExit) as e: - with patch('sys.argv', ['omniperf', 'analyze', '--path', 'tests/workloads/dispatch_invalid/MI100']): + with patch( + "sys.argv", + ["omniperf", "analyze", "--path", "tests/workloads/dispatch_invalid/MI100"], + ): omniperf.main() - assert (e.value.code == 0) + assert e.value.code == 0 + def test_ipblocks_CPC_MI100(): with pytest.raises(SystemExit) as e: - with patch('sys.argv', ['omniperf', 'analyze', '--path', 'tests/workloads/ipblocks_CPC/MI100']): + with patch( + "sys.argv", + ["omniperf", "analyze", "--path", "tests/workloads/ipblocks_CPC/MI100"], + ): omniperf.main() - assert (e.value.code == 0) + assert e.value.code == 0 + def test_ipblocks_CPF_MI100(): with pytest.raises(SystemExit) as e: - with patch('sys.argv', ['omniperf', 'analyze', '--path', 'tests/workloads/ipblocks_CPF/MI100']): + with patch( + "sys.argv", + ["omniperf", "analyze", "--path", "tests/workloads/ipblocks_CPF/MI100"], + ): omniperf.main() - assert (e.value.code == 0) + assert e.value.code == 0 + def test_ipblocks_SPI_MI100(): with pytest.raises(SystemExit) as e: - with patch('sys.argv', ['omniperf', 'analyze', '--path', 'tests/workloads/ipblocks_SPI/MI100']): + with patch( + "sys.argv", + ["omniperf", "analyze", "--path", "tests/workloads/ipblocks_SPI/MI100"], + ): omniperf.main() - assert (e.value.code == 0) + assert e.value.code == 0 + def test_ipblocks_SQC_MI100(): with pytest.raises(SystemExit) as e: - with patch('sys.argv', ['omniperf', 'analyze', '--path', 'tests/workloads/ipblocks_SQC/MI100']): + with patch( + "sys.argv", + ["omniperf", "analyze", "--path", "tests/workloads/ipblocks_SQC/MI100"], + ): omniperf.main() - assert (e.value.code == 0) + assert e.value.code == 0 + def test_ipblocks_SQ_CPC_MI100(): with pytest.raises(SystemExit) as e: - with patch('sys.argv', ['omniperf', 'analyze', '--path', 'tests/workloads/ipblocks_SQ_CPC/MI100']): + with patch( + "sys.argv", + ["omniperf", "analyze", "--path", "tests/workloads/ipblocks_SQ_CPC/MI100"], + ): omniperf.main() - assert (e.value.code == 0) + assert e.value.code == 0 + def test_ipblocks_SQ_MI100(): with pytest.raises(SystemExit) as e: - with patch('sys.argv', ['omniperf', 'analyze', '--path', 'tests/workloads/ipblocks_SQ/MI100']): + with patch( + "sys.argv", + ["omniperf", "analyze", "--path", "tests/workloads/ipblocks_SQ/MI100"], + ): omniperf.main() - assert (e.value.code == 0) + assert e.value.code == 0 + def test_ipblocks_SQ_SPI_MI100(): with pytest.raises(SystemExit) as e: - with patch('sys.argv', ['omniperf', 'analyze', '--path', 'tests/workloads/ipblocks_SQ_SPI/MI100']): + with patch( + "sys.argv", + ["omniperf", "analyze", "--path", "tests/workloads/ipblocks_SQ_SPI/MI100"], + ): omniperf.main() - assert (e.value.code == 0) + assert e.value.code == 0 + def test_ipblocks_SQ_SPI_TA_TCC_CPF_MI100(): with pytest.raises(SystemExit) as e: - with patch('sys.argv', ['omniperf', 'analyze', '--path', 'tests/workloads/ipblocks_SQ_SPI_TA_TCC_CPF/MI100']): + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + "tests/workloads/ipblocks_SQ_SPI_TA_TCC_CPF/MI100", + ], + ): omniperf.main() - assert (e.value.code == 0) + assert e.value.code == 0 + def test_ipblocks_SQ_SQC_TCP_CPC_MI100(): with pytest.raises(SystemExit) as e: - with patch('sys.argv', ['omniperf', 'analyze', '--path', 'tests/workloads/ipblocks_SQ_SQC_TCP_CPC/MI100']): + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + "tests/workloads/ipblocks_SQ_SQC_TCP_CPC/MI100", + ], + ): omniperf.main() - assert (e.value.code == 0) + assert e.value.code == 0 + def test_ipblocks_SQ_TA_MI100(): with pytest.raises(SystemExit) as e: - with patch('sys.argv', ['omniperf', 'analyze', '--path', 'tests/workloads/ipblocks_SQ_TA/MI100']): + with patch( + "sys.argv", + ["omniperf", "analyze", "--path", "tests/workloads/ipblocks_SQ_TA/MI100"], + ): omniperf.main() - assert (e.value.code == 0) + assert e.value.code == 0 + def test_ipblocks_TA_MI100(): with pytest.raises(SystemExit) as e: - with patch('sys.argv', ['omniperf', 'analyze', '--path', 'tests/workloads/ipblocks_TA/MI100']): + with patch( + "sys.argv", + ["omniperf", "analyze", "--path", "tests/workloads/ipblocks_TA/MI100"], + ): omniperf.main() - assert (e.value.code == 0) + assert e.value.code == 0 + def test_ipblocks_TCC_MI100(): with pytest.raises(SystemExit) as e: - with patch('sys.argv', ['omniperf', 'analyze', '--path', 'tests/workloads/ipblocks_TCC/MI100']): + with patch( + "sys.argv", + ["omniperf", "analyze", "--path", "tests/workloads/ipblocks_TCC/MI100"], + ): omniperf.main() - assert (e.value.code == 0) + assert e.value.code == 0 + def test_ipblocks_TCP_MI100(): with pytest.raises(SystemExit) as e: - with patch('sys.argv', ['omniperf', 'analyze', '--path', 'tests/workloads/ipblocks_TCP/MI100']): + with patch( + "sys.argv", + ["omniperf", "analyze", "--path", "tests/workloads/ipblocks_TCP/MI100"], + ): omniperf.main() - assert (e.value.code == 0) + assert e.value.code == 0 + def test_ipblocks_TD_MI100(): with pytest.raises(SystemExit) as e: - with patch('sys.argv', ['omniperf', 'analyze', '--path', 'tests/workloads/ipblocks_TD/MI100']): + with patch( + "sys.argv", + ["omniperf", "analyze", "--path", "tests/workloads/ipblocks_TD/MI100"], + ): omniperf.main() - assert (e.value.code == 0) + assert e.value.code == 0 + def test_join_type_grid_MI100(): with pytest.raises(SystemExit) as e: - with patch('sys.argv', ['omniperf', 'analyze', '--path', 'tests/workloads/join_type_grid/MI100']): + with patch( + "sys.argv", + ["omniperf", "analyze", "--path", "tests/workloads/join_type_grid/MI100"], + ): omniperf.main() - assert (e.value.code == 0) + assert e.value.code == 0 + def test_join_type_kernel_MI100(): with pytest.raises(SystemExit) as e: - with patch('sys.argv', ['omniperf', 'analyze', '--path', 'tests/workloads/join_type_kernel/MI100']): + with patch( + "sys.argv", + ["omniperf", "analyze", "--path", "tests/workloads/join_type_kernel/MI100"], + ): omniperf.main() + def test_kernel_inv_int_MI100(): with pytest.raises(SystemExit) as e: - with patch('sys.argv', ['omniperf', 'analyze', '--path', 'tests/workloads/kernel_inv_int/MI100']): + with patch( + "sys.argv", + ["omniperf", "analyze", "--path", "tests/workloads/kernel_inv_int/MI100"], + ): omniperf.main() - assert (e.value.code == 1) + assert e.value.code == 1 + def test_kernel_inv_str_MI100(): with pytest.raises(SystemExit) as e: - with patch('sys.argv', ['omniperf', 'analyze', '--path', 'tests/workloads/kernel_inv_str/MI100']): + with patch( + "sys.argv", + ["omniperf", "analyze", "--path", "tests/workloads/kernel_inv_str/MI100"], + ): omniperf.main() - assert (e.value.code == 1) + assert e.value.code == 1 + def test_kernel_substr_MI100(): with pytest.raises(SystemExit) as e: - with patch('sys.argv', ['omniperf', 'analyze', '--path', 'tests/workloads/kernel_substr/MI100']): + with patch( + "sys.argv", + ["omniperf", "analyze", "--path", "tests/workloads/kernel_substr/MI100"], + ): omniperf.main() - assert (e.value.code == 0) + assert e.value.code == 0 + def test_kernel_summaries_MI100(): with pytest.raises(SystemExit) as e: - with patch('sys.argv', ['omniperf', 'analyze', '--path', 'tests/workloads/kernel_summaries/MI100']): + with patch( + "sys.argv", + ["omniperf", "analyze", "--path", "tests/workloads/kernel_summaries/MI100"], + ): omniperf.main() - assert (e.value.code == 0) + assert e.value.code == 0 + def test_kernel_verbose_0_MI100(): with pytest.raises(SystemExit) as e: - with patch('sys.argv', ['omniperf', 'analyze', '--path', 'tests/workloads/kernel_verbose_0/MI100']): + with patch( + "sys.argv", + ["omniperf", "analyze", "--path", "tests/workloads/kernel_verbose_0/MI100"], + ): omniperf.main() - assert (e.value.code == 0) + assert e.value.code == 0 + def test_kernel_verbose_1_MI100(): with pytest.raises(SystemExit) as e: - with patch('sys.argv', ['omniperf', 'analyze', '--path', 'tests/workloads/kernel_verbose_1/MI100']): + with patch( + "sys.argv", + ["omniperf", "analyze", "--path", "tests/workloads/kernel_verbose_1/MI100"], + ): omniperf.main() - assert (e.value.code == 0) + assert e.value.code == 0 + def test_kernel_verbose_2_MI100(): with pytest.raises(SystemExit) as e: - with patch('sys.argv', ['omniperf', 'analyze', '--path', 'tests/workloads/kernel_verbose_2/MI100']): + with patch( + "sys.argv", + ["omniperf", "analyze", "--path", "tests/workloads/kernel_verbose_2/MI100"], + ): omniperf.main() - assert (e.value.code == 0) + assert e.value.code == 0 + def test_kernel_verbose_3_MI100(): with pytest.raises(SystemExit) as e: - with patch('sys.argv', ['omniperf', 'analyze', '--path', 'tests/workloads/kernel_verbose_3/MI100']): + with patch( + "sys.argv", + ["omniperf", "analyze", "--path", "tests/workloads/kernel_verbose_3/MI100"], + ): omniperf.main() - assert (e.value.code == 0) + assert e.value.code == 0 + def test_kernel_verbose_4_MI100(): with pytest.raises(SystemExit) as e: - with patch('sys.argv', ['omniperf', 'analyze', '--path', 'tests/workloads/kernel_verbose_4/MI100']): + with patch( + "sys.argv", + ["omniperf", "analyze", "--path", "tests/workloads/kernel_verbose_4/MI100"], + ): omniperf.main() - assert (e.value.code == 0) + assert e.value.code == 0 + def test_kernel_verbose_5_MI100(): with pytest.raises(SystemExit) as e: - with patch('sys.argv', ['omniperf', 'analyze', '--path', 'tests/workloads/kernel_verbose_5/MI100']): + with patch( + "sys.argv", + ["omniperf", "analyze", "--path", "tests/workloads/kernel_verbose_5/MI100"], + ): omniperf.main() - assert (e.value.code == 0) + assert e.value.code == 0 + def test_no_roof_MI100(): with pytest.raises(SystemExit) as e: - with patch('sys.argv', ['omniperf', 'analyze', '--path', 'tests/workloads/no_roof/MI100']): + with patch( + "sys.argv", ["omniperf", "analyze", "--path", "tests/workloads/no_roof/MI100"] + ): omniperf.main() - assert (e.value.code == 0) + assert e.value.code == 0 + def test_path_MI100(): with pytest.raises(SystemExit) as e: - with patch('sys.argv', ['omniperf', 'analyze', '--path', 'tests/workloads/path/MI100']): + with patch( + "sys.argv", ["omniperf", "analyze", "--path", "tests/workloads/path/MI100"] + ): omniperf.main() - assert (e.value.code == 0) + assert e.value.code == 0