diff --git a/components/nvs_flash/test_apps/pytest_nvs_flash.py b/components/nvs_flash/test_apps/pytest_nvs_flash.py index bfd5bc5941..406bba61e0 100644 --- a/components/nvs_flash/test_apps/pytest_nvs_flash.py +++ b/components/nvs_flash/test_apps/pytest_nvs_flash.py @@ -1,6 +1,5 @@ # SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: Apache-2.0 - import pytest from pytest_embedded_idf.dut import IdfDut diff --git a/examples/storage/nvs_rw_value/pytest_nvs_rw_value.py b/examples/storage/nvs_rw_value/pytest_nvs_rw_value.py index a04d33a383..6d918b130a 100644 --- a/examples/storage/nvs_rw_value/pytest_nvs_rw_value.py +++ b/examples/storage/nvs_rw_value/pytest_nvs_rw_value.py @@ -11,6 +11,8 @@ from pytest_embedded import Dut @pytest.mark.esp32c3 @pytest.mark.generic def test_examples_nvs_rw_value(dut: Dut) -> None: + dut.serial.erase_flash() + dut.serial.flash() for i, counter_state in zip_longest(range(4), ('The value is not initialized yet!',), fillvalue='Done'): dut.expect('Opening Non-Volatile Storage \\(NVS\\) handle... Done', timeout=20) dut.expect('Reading restart counter from NVS ... {}'.format(counter_state), timeout=20) diff --git a/examples/storage/nvs_rw_value_cxx/pytest_nvs_rw_value_cxx.py b/examples/storage/nvs_rw_value_cxx/pytest_nvs_rw_value_cxx.py index b085002ae3..1666d62c4d 100644 --- a/examples/storage/nvs_rw_value_cxx/pytest_nvs_rw_value_cxx.py +++ b/examples/storage/nvs_rw_value_cxx/pytest_nvs_rw_value_cxx.py @@ -11,6 +11,8 @@ from pytest_embedded import Dut @pytest.mark.esp32c3 @pytest.mark.generic def test_examples_nvs_rw_value_cxx(dut: Dut) -> None: + dut.serial.erase_flash() + dut.serial.flash() for i, counter_state in zip_longest(range(4), ('The value is not initialized yet!',), fillvalue='Done'): dut.expect('Opening Non-Volatile Storage \\(NVS\\) handle... Done', timeout=20) dut.expect('Reading restart counter from NVS ... {}'.format(counter_state), timeout=20)