From e0a13db050354106decb1c78d8760bc80a59d025 Mon Sep 17 00:00:00 2001 From: roman-janik-nxp Date: Fri, 16 Oct 2026 13:04:52 +0200 Subject: [PATCH] NXP backend: Shorten test names --- backends/nxp/tests/generic_tests/test_debug_results.py | 2 +- .../nxp/tests/models/test_mlperf_tiny_anomaly_detection.py | 2 +- .../tests/models/test_mlperf_tiny_image_classification.py | 4 +--- .../nxp/tests/models/test_mlperf_tiny_keyword_spotting.py | 2 +- .../nxp/tests/models/test_mlperf_tiny_visual_wake_words.py | 2 +- backends/nxp/tests/models/test_mobilenet_v2.py | 2 +- backends/nxp/tests/nsys_testing.py | 5 ++++- 7 files changed, 10 insertions(+), 9 deletions(-) diff --git a/backends/nxp/tests/generic_tests/test_debug_results.py b/backends/nxp/tests/generic_tests/test_debug_results.py index 4d4c1e13f53..1824743244c 100644 --- a/backends/nxp/tests/generic_tests/test_debug_results.py +++ b/backends/nxp/tests/generic_tests/test_debug_results.py @@ -119,7 +119,7 @@ def test_nsys_test_debug_results__multiple_input(self, caplog, request): test_name = get_test_name(request) # Running by CI scripts adds prefix to the name assert ( - "TestNsysDebugResults__test_nsys_test_debug_results__multiple_input" + "TestNsysDebugResults_test_nsys_test_debug_results__multiple_input" in test_name ) assert os.path.isdir( diff --git a/backends/nxp/tests/models/test_mlperf_tiny_anomaly_detection.py b/backends/nxp/tests/models/test_mlperf_tiny_anomaly_detection.py index 57e7640cf62..de95c4cfcfc 100644 --- a/backends/nxp/tests/models/test_mlperf_tiny_anomaly_detection.py +++ b/backends/nxp/tests/models/test_mlperf_tiny_anomaly_detection.py @@ -35,7 +35,7 @@ def reseed_model_per_test_run(): np.random.seed(23) -def test_mlperf_tiny_anomaly_detection_mse_cpu_vs_npu( +def test_ad_mse_cpu_vs_npu( mocker, request, use_qat, diff --git a/backends/nxp/tests/models/test_mlperf_tiny_image_classification.py b/backends/nxp/tests/models/test_mlperf_tiny_image_classification.py index 8a1a462f8a4..83862236fb2 100644 --- a/backends/nxp/tests/models/test_mlperf_tiny_image_classification.py +++ b/backends/nxp/tests/models/test_mlperf_tiny_image_classification.py @@ -38,9 +38,7 @@ def reseed_model_per_test_run(): @pytest.mark.parametrize("channels_last", [False, True]) -def test_mlperf_tiny_classification_mse_cpu_vs_npu( - mocker, request, channels_last, use_qat -): +def test_ic_mse_cpu_vs_npu(mocker, request, channels_last, use_qat): num_samples = 1 img_classification = MLPerfTinyImageClassification( diff --git a/backends/nxp/tests/models/test_mlperf_tiny_keyword_spotting.py b/backends/nxp/tests/models/test_mlperf_tiny_keyword_spotting.py index 6fa48716619..ee9e1b35c82 100644 --- a/backends/nxp/tests/models/test_mlperf_tiny_keyword_spotting.py +++ b/backends/nxp/tests/models/test_mlperf_tiny_keyword_spotting.py @@ -44,7 +44,7 @@ def reseed_model_per_test_run(): @pytest.mark.parametrize("channels_last", [False, True]) -def test_mlperf_tiny_kws_mse_cpu_vs_npu(mocker, request, channels_last, use_qat): +def test_kws_mse_cpu_vs_npu(mocker, request, channels_last, use_qat): num_samples = 1 kws = MLPerfTinyKeywordSpotting( diff --git a/backends/nxp/tests/models/test_mlperf_tiny_visual_wake_words.py b/backends/nxp/tests/models/test_mlperf_tiny_visual_wake_words.py index 56ba1d155b9..4247595cd19 100644 --- a/backends/nxp/tests/models/test_mlperf_tiny_visual_wake_words.py +++ b/backends/nxp/tests/models/test_mlperf_tiny_visual_wake_words.py @@ -38,7 +38,7 @@ def reseed_model_per_test_run(): @pytest.mark.parametrize("channels_last", [False, True]) -def test_mlperf_tiny_vww_mse_cpu_vs_npu(mocker, request, channels_last, use_qat): +def test_vww_mse_cpu_vs_npu(mocker, request, channels_last, use_qat): num_samples = 1 visual_wake_words = MLPerfTinyVisualWakeWords( diff --git a/backends/nxp/tests/models/test_mobilenet_v2.py b/backends/nxp/tests/models/test_mobilenet_v2.py index b06d0ccbf1c..4ab3bae35bd 100644 --- a/backends/nxp/tests/models/test_mobilenet_v2.py +++ b/backends/nxp/tests/models/test_mobilenet_v2.py @@ -36,7 +36,7 @@ def reseed_model_per_test_run(): @pytest.mark.parametrize("channels_last", [False, True]) -def test_mobilenet_v2_mse_cpu_vs_npu( +def test_mv2_mse_cpu_vs_npu( mocker, request, channels_last, diff --git a/backends/nxp/tests/nsys_testing.py b/backends/nxp/tests/nsys_testing.py index 4f7d3a3fa02..c74d92cbd6f 100644 --- a/backends/nxp/tests/nsys_testing.py +++ b/backends/nxp/tests/nsys_testing.py @@ -809,7 +809,10 @@ def _parse_input_quant_params( def get_test_name(request): # PyTest request is available, extract correct name including test class and params - test_name = request.node.nodeid.lstrip(":") + test_filename = request.path.name + test_class_name = getattr(request.node.cls, "__name__", "") + test_function_name = request.node.name + test_name = test_filename + "_" + test_class_name + "_" + test_function_name # Escape unacceptable characters from test name to make sure it is a valid filesystem directory name test_name = re.sub(r'[<>:"/\\|?* ,()`]', "_", test_name) test_name = test_name.strip(" .")