pytest_flash_suspend.py 774 B

123456789101112131415161718192021
  1. # SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
  2. # SPDX-License-Identifier: CC0-1.0
  3. import pytest
  4. from pytest_embedded.dut import Dut
  5. @pytest.mark.esp32c3
  6. @pytest.mark.flash_suspend
  7. @pytest.mark.parametrize('config', [
  8. 'flash_suspend',
  9. ], indirect=True)
  10. def test_flash_suspend_example(dut: Dut) -> None:
  11. dut.expect_exact('found partition')
  12. res = dut.expect(r'During Erase, ISR callback function\(in flash\) response time:\s+(\d+(\.\d{1,2})) us')
  13. response_time = res.group(1).decode('utf8')
  14. assert 0 <= float(response_time) < 120
  15. res = dut.expect(r'During Erase, ISR callback function\(in iram\) response time:\s+(\d+(\.\d{1,2})) us')
  16. response_time = res.group(1).decode('utf8')
  17. assert 0 <= float(response_time) < 5