Skip to content

Commit 26a01e8

Browse files
committed
Merge branch 'ci/known-failure-dut-id' into 'master'
ci: pytest-ignore skip using dut id Closes CII-44 See merge request espressif/esp-idf!43539
2 parents a952397 + 0832007 commit 26a01e8

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tools/ci/idf_pytest/plugin.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ def requires_elf_or_map(case: PytestCase) -> bool:
4848
return False
4949

5050

51-
def skipped_targets(item: Function) -> t.Set[str]:
52-
def _get_temp_markers_disabled_targets(marker_name: str) -> t.Set[str]:
51+
def skipped_targets(item: Function) -> set[str]:
52+
def _get_temp_markers_disabled_targets(marker_name: str) -> set[str]:
5353
temp_marker = item.get_closest_marker(marker_name)
5454

5555
if not temp_marker:
@@ -102,7 +102,7 @@ def __init__(self) -> None:
102102
with open(KNOWN_GENERATE_TEST_CHILD_PIPELINE_WARNINGS_FILEPATH) as fr:
103103
known_warnings_dict = yaml.safe_load(fr) or dict()
104104

105-
self.exclude_no_env_markers_test_cases: t.Set[str] = set(known_warnings_dict['no_env_marker_test_cases'])
105+
self.exclude_no_env_markers_test_cases: set[str] = set(known_warnings_dict['no_env_marker_test_cases'])
106106

107107
@staticmethod
108108
def get_param(item: Function, key: str, default: t.Any = None) -> t.Any:
@@ -114,7 +114,7 @@ def get_param(item: Function, key: str, default: t.Any = None) -> t.Any:
114114
return item.callspec.params.get(key, default) or default
115115

116116
@pytest.hookimpl(wrapper=True)
117-
def pytest_collection_modifyitems(self, config: Config, items: t.List[Function]) -> t.Generator[None, None, None]:
117+
def pytest_collection_modifyitems(self, config: Config, items: list[Function]) -> t.Generator[None, None, None]:
118118
yield # throw it back to idf-ci
119119

120120
deselected_items = []
@@ -176,14 +176,14 @@ def pytest_runtest_makereport(self, item: Function, call: CallInfo[None]) -> Non
176176
config = item.funcargs['config']
177177
is_qemu = item.get_closest_marker('qemu') is not None
178178

179-
dut: t.Union[Dut, t.Tuple[Dut]] = item.funcargs['dut'] # type: ignore
180-
if isinstance(dut, (list, tuple)):
179+
dut: Dut | tuple[Dut] = item.funcargs['dut'] # type: ignore
180+
if isinstance(dut, (list | tuple)):
181181
res = []
182182
for i, _dut in enumerate(dut):
183183
res.extend(
184184
[
185185
ChildCase(
186-
format_case_id(target, config, case.name + f' {i}', is_qemu=is_qemu),
186+
format_case_id(target, config, case.name, is_qemu=is_qemu),
187187
self.UNITY_RESULT_MAPPINGS[case.result],
188188
)
189189
for case in _dut.testsuite.testcases
@@ -206,7 +206,7 @@ def pytest_runtest_teardown(self, item: Function) -> None:
206206
"""
207207
Modify the junit reports. Format the unity c test case names.
208208
"""
209-
tempdir: t.Optional[str] = item.funcargs.get('test_case_tempdir') # type: ignore
209+
tempdir: str | None = item.funcargs.get('test_case_tempdir') # type: ignore
210210
if not tempdir:
211211
return
212212

0 commit comments

Comments
 (0)