test: format all test scripts

This commit is contained in:
igor.udot
2025-02-24 10:18:03 +08:00
parent 717c18a58e
commit daf2d31008
381 changed files with 6180 additions and 4289 deletions

View File

@@ -1,9 +1,10 @@
# SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
# SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: CC0-1.0
import logging
import pytest
from pytest_embedded import Dut
from pytest_embedded_idf.utils import idf_parametrize
STARTING_TIMERS_REGEX = r'Started timers, time since boot: (\d+) us'
@@ -27,17 +28,16 @@ LIGHT_SLEEP_TIME = 500000
ONE_SHOT_TIMER_PERIOD = 5000000
@pytest.mark.supported_targets
@pytest.mark.generic
@pytest.mark.parametrize(
'config',
[
'rtc',
],
indirect=True
indirect=True,
)
@idf_parametrize('target', ['supported_targets'], indirect=['target'])
def test_esp_timer(dut: Dut) -> None:
match = dut.expect(STARTING_TIMERS_REGEX)
start_time = int(match.group(1))
logging.info('Start time: {} us'.format(start_time))
@@ -78,8 +78,7 @@ def test_esp_timer(dut: Dut) -> None:
sleep_exit_time = int(match.group(1))
sleep_time = sleep_exit_time - sleep_enter_time
logging.info('Enter sleep: {}, exit sleep: {}, slept: {}'.format(
sleep_enter_time, sleep_exit_time, sleep_time))
logging.info('Enter sleep: {}, exit sleep: {}, slept: {}'.format(sleep_enter_time, sleep_exit_time, sleep_time))
assert -2000 < sleep_time - LIGHT_SLEEP_TIME < 1000