From ed5a540439bcb65143df8a60d6cbb6fc21e0aba6 Mon Sep 17 00:00:00 2001 From: Konstantin Kondrashov Date: Tue, 29 Oct 2024 10:09:42 +0200 Subject: [PATCH] fix(examples): Fix pytest_otatool for C2 Test for C2 has to be run with flash_4mb --- examples/system/ota/otatool/pytest_otatool.py | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/examples/system/ota/otatool/pytest_otatool.py b/examples/system/ota/otatool/pytest_otatool.py index c077034736..a8fe39976a 100644 --- a/examples/system/ota/otatool/pytest_otatool.py +++ b/examples/system/ota/otatool/pytest_otatool.py @@ -8,7 +8,11 @@ import pytest from pytest_embedded import Dut -def _real_test_func(dut: Dut) -> None: +@pytest.mark.parametrize('config', [ + pytest.param('default', marks=[pytest.mark.supported_targets, pytest.mark.generic, pytest.mark.temp_skip(targets=['esp32c2'], reason='must have 4MB')]), + pytest.param('default', marks=[pytest.mark.esp32c2, pytest.mark.generic, pytest.mark.flash_4mb]), +], indirect=True) +def test_otatool_example(dut: Dut) -> None: # Verify factory firmware dut.expect('OTA Tool Example') dut.expect('Example end') @@ -24,16 +28,3 @@ def _real_test_func(dut: Dut) -> None: binary_path = flash_file[1] break subprocess.check_call([sys.executable, script_path, '--binary', binary_path]) - - -@pytest.mark.supported_targets -@pytest.mark.generic -def test_otatool_example(dut: Dut) -> None: - _real_test_func(dut) - - -@pytest.mark.esp32c2 -@pytest.mark.generic -@pytest.mark.flash_4mb -def test_otatool_example_c2_4mb(dut: Dut) -> None: - _real_test_func(dut)