From 61aafd1e89a880bc9856f6367a4cfc4b5682066d Mon Sep 17 00:00:00 2001 From: Fu Hanxi Date: Mon, 15 Jan 2024 14:33:48 +0100 Subject: [PATCH] ci: fix download with multi-dut test cases with markers only --- conftest.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/conftest.py b/conftest.py index 92a6fceb44..4820cbf1df 100644 --- a/conftest.py +++ b/conftest.py @@ -79,6 +79,17 @@ def config(request: FixtureRequest) -> str: return getattr(request, 'param', None) or DEFAULT_SDKCONFIG # type: ignore +@pytest.fixture +@multi_dut_fixture +def target(request: FixtureRequest, dut_total: int, dut_index: int) -> str: + plugin = request.config.stash[IDF_PYTEST_EMBEDDED_KEY] + + if dut_total == 1: + return plugin.target[0] # type: ignore + + return plugin.target[dut_index] # type: ignore + + @pytest.fixture def test_func_name(request: FixtureRequest) -> str: return request.node.function.__name__ # type: ignore