mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-08 20:21:04 +00:00
test: format all test scripts
This commit is contained in:
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user