mirror of
https://github.com/espressif/esp-idf.git
synced 2025-12-07 17:08:49 +00:00
test: format all test scripts
This commit is contained in:
@@ -1,13 +1,22 @@
|
||||
# SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
import pytest
|
||||
|
||||
|
||||
from pytest_embedded_idf.utils import idf_parametrize
|
||||
# If `test_env` is define, should not run on generic runner
|
||||
@pytest.mark.supported_targets
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.parametrize('config', ['release', 'freertos_compliance', 'freertos_flash',], indirect=True)
|
||||
def test_master_single_dev(case_tester) -> None: # type: ignore
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
[
|
||||
'release',
|
||||
'freertos_compliance',
|
||||
'freertos_flash',
|
||||
],
|
||||
indirect=True,
|
||||
)
|
||||
@idf_parametrize('target', ['supported_targets'], indirect=['target'])
|
||||
def test_master_single_dev(case_tester) -> None: # type: ignore
|
||||
for case in case_tester.test_menu:
|
||||
if 'test_env' in case.attributes:
|
||||
continue
|
||||
@@ -15,10 +24,16 @@ def test_master_single_dev(case_tester) -> None: # type: ignore
|
||||
|
||||
|
||||
# Job for test_env `external_flash` just for esp32 only
|
||||
@pytest.mark.esp32
|
||||
@pytest.mark.flash_multi
|
||||
@pytest.mark.parametrize('config', ['release',], indirect=True)
|
||||
def test_master_esp_flash(case_tester) -> None: # type: ignore
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
[
|
||||
'release',
|
||||
],
|
||||
indirect=True,
|
||||
)
|
||||
@idf_parametrize('target', ['esp32'], indirect=['target'])
|
||||
def test_master_esp_flash(case_tester) -> None: # type: ignore
|
||||
for case in case_tester.test_menu:
|
||||
# test case `spi_bus_lock_with_flash` use difference test env
|
||||
if case.attributes.get('test_env') == 'external_flash':
|
||||
@@ -28,19 +43,28 @@ def test_master_esp_flash(case_tester) -> None: # type: ignore
|
||||
# if `test_env` not defined, will run on `generic_multi_device` by default
|
||||
# TODO: [ESP32C61] IDF-10949
|
||||
@pytest.mark.temp_skip_ci(targets=['esp32c61'], reason='no multi-dev runner')
|
||||
@pytest.mark.supported_targets
|
||||
@pytest.mark.generic_multi_device
|
||||
@pytest.mark.parametrize(
|
||||
'count, config',
|
||||
[
|
||||
(2, 'release',),
|
||||
(2, 'freertos_compliance',),
|
||||
(2, 'freertos_flash',),
|
||||
(
|
||||
2,
|
||||
'release',
|
||||
),
|
||||
(
|
||||
2,
|
||||
'freertos_compliance',
|
||||
),
|
||||
(
|
||||
2,
|
||||
'freertos_flash',
|
||||
),
|
||||
(2, 'iram_safe'),
|
||||
],
|
||||
indirect=True
|
||||
indirect=True,
|
||||
)
|
||||
def test_master_multi_dev(case_tester) -> None: # type: ignore
|
||||
@idf_parametrize('target', ['supported_targets'], indirect=['target'])
|
||||
def test_master_multi_dev(case_tester) -> None: # type: ignore
|
||||
for case in case_tester.test_menu:
|
||||
if case.attributes.get('test_env', 'generic_multi_device') == 'generic_multi_device':
|
||||
case_tester.run_multi_dev_case(case=case, reset=True)
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
# SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
import pytest
|
||||
|
||||
|
||||
from pytest_embedded_idf.utils import idf_parametrize
|
||||
# If `test_env` is define, should not run on generic runner
|
||||
@pytest.mark.supported_targets
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
def test_param_single_dev(case_tester) -> None: # type: ignore
|
||||
@idf_parametrize('target', ['supported_targets'], indirect=['target'])
|
||||
def test_param_single_dev(case_tester) -> None: # type: ignore
|
||||
for case in case_tester.test_menu:
|
||||
if 'test_env' in case.attributes:
|
||||
continue
|
||||
@@ -16,10 +17,16 @@ def test_param_single_dev(case_tester) -> None: # type: ignore
|
||||
# if `test_env` not defined, will run on `generic_multi_device` by default
|
||||
# TODO: [ESP32C61] IDF-10949
|
||||
@pytest.mark.temp_skip_ci(targets=['esp32c61'], reason='no multi-dev runner')
|
||||
@pytest.mark.supported_targets
|
||||
@pytest.mark.generic_multi_device
|
||||
@pytest.mark.parametrize('count', [2,], indirect=True)
|
||||
def test_param_multi_dev(case_tester) -> None: # type: ignore
|
||||
@pytest.mark.parametrize(
|
||||
'count',
|
||||
[
|
||||
2,
|
||||
],
|
||||
indirect=True,
|
||||
)
|
||||
@idf_parametrize('target', ['supported_targets'], indirect=['target'])
|
||||
def test_param_multi_dev(case_tester) -> None: # type: ignore
|
||||
for case in case_tester.test_menu:
|
||||
if case.attributes.get('test_env', 'generic_multi_device') == 'generic_multi_device':
|
||||
case_tester.run_multi_dev_case(case=case, reset=True)
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
# SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
import pytest
|
||||
|
||||
|
||||
from pytest_embedded_idf.utils import idf_parametrize
|
||||
# If `test_env` is define, should not run on generic runner
|
||||
@pytest.mark.supported_targets
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.parametrize('config', ['release', 'iram_safe'], indirect=True)
|
||||
def test_slave_single_dev(case_tester) -> None: # type: ignore
|
||||
@idf_parametrize('target', ['supported_targets'], indirect=['target'])
|
||||
def test_slave_single_dev(case_tester) -> None: # type: ignore
|
||||
for case in case_tester.test_menu:
|
||||
if 'test_env' in case.attributes:
|
||||
continue
|
||||
@@ -17,10 +18,10 @@ def test_slave_single_dev(case_tester) -> None: # type: ignore
|
||||
# if `test_env` not defined, will run on `generic_multi_device` by default
|
||||
# TODO: [ESP32C61] IDF-10949
|
||||
@pytest.mark.temp_skip_ci(targets=['esp32c61'], reason='no multi-dev runner')
|
||||
@pytest.mark.supported_targets
|
||||
@pytest.mark.generic_multi_device
|
||||
@pytest.mark.parametrize('count, config', [(2, 'release'), (2, 'iram_safe')], indirect=True)
|
||||
def test_slave_multi_dev(case_tester) -> None: # type: ignore
|
||||
@idf_parametrize('target', ['supported_targets'], indirect=['target'])
|
||||
def test_slave_multi_dev(case_tester) -> None: # type: ignore
|
||||
for case in case_tester.test_menu:
|
||||
if case.attributes.get('test_env', 'generic_multi_device') == 'generic_multi_device':
|
||||
case_tester.run_multi_dev_case(case=case, reset=True)
|
||||
|
||||
@@ -1,21 +1,18 @@
|
||||
# SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
import pytest
|
||||
|
||||
|
||||
from pytest_embedded_idf.utils import idf_parametrize
|
||||
# If `test_env` is define, should not run on generic runner
|
||||
@pytest.mark.esp32s2
|
||||
@pytest.mark.esp32s3
|
||||
@pytest.mark.esp32c2
|
||||
@pytest.mark.esp32c3
|
||||
@pytest.mark.esp32c5
|
||||
@pytest.mark.esp32c6
|
||||
@pytest.mark.esp32c61
|
||||
@pytest.mark.esp32h2
|
||||
@pytest.mark.esp32p4
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.parametrize('config', ['release'], indirect=True)
|
||||
def test_slave_hd_single_dev(case_tester) -> None: # type: ignore
|
||||
@idf_parametrize(
|
||||
'target',
|
||||
['esp32s2', 'esp32s3', 'esp32c2', 'esp32c3', 'esp32c5', 'esp32c6', 'esp32c61', 'esp32h2', 'esp32p4'],
|
||||
indirect=['target'],
|
||||
)
|
||||
def test_slave_hd_single_dev(case_tester) -> None: # type: ignore
|
||||
for case in case_tester.test_menu:
|
||||
if 'test_env' in case.attributes:
|
||||
continue
|
||||
@@ -23,17 +20,14 @@ def test_slave_hd_single_dev(case_tester) -> None: # type: ignore
|
||||
|
||||
|
||||
# if `test_env` not defined, will run on `generic_multi_device` by default
|
||||
@pytest.mark.esp32s2
|
||||
@pytest.mark.esp32s3
|
||||
@pytest.mark.esp32c2
|
||||
@pytest.mark.esp32c3
|
||||
@pytest.mark.esp32c5
|
||||
@pytest.mark.esp32c6
|
||||
@pytest.mark.esp32h2
|
||||
@pytest.mark.esp32p4
|
||||
@pytest.mark.generic_multi_device
|
||||
@pytest.mark.parametrize('count, config', [(2, 'release')], indirect=True)
|
||||
def test_slave_hd_multi_dev(case_tester) -> None: # type: ignore
|
||||
@idf_parametrize(
|
||||
'target',
|
||||
['esp32s2', 'esp32s3', 'esp32c2', 'esp32c3', 'esp32c5', 'esp32c6', 'esp32h2', 'esp32p4'],
|
||||
indirect=['target'],
|
||||
)
|
||||
def test_slave_hd_multi_dev(case_tester) -> None: # type: ignore
|
||||
for case in case_tester.test_menu:
|
||||
if case.attributes.get('test_env', 'generic_multi_device') == 'generic_multi_device':
|
||||
case_tester.run_multi_dev_case(case=case, reset=True)
|
||||
|
||||
Reference in New Issue
Block a user