Skip to content

Commit 356ad78

Browse files
committed
Run only selected tests + wait
1 parent 49ed592 commit 356ad78

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

conftest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import cv2
55
import subprocess
66
import numpy as np
7+
import time
78
from pathlib import Path
89

910

@@ -130,10 +131,11 @@ def bsp_test_image(board, example, expectation):
130131

131132

132133
@pytest.fixture()
133-
def bsp_test(request):
134+
def bsp_test_capture_image(request):
134135
board = request.node.callspec.id
135136
path = Path(str(request.node.fspath))
136137
test_name = path.parent.name
137138
yield
139+
time.sleep(5) # wait 5 seconds
138140
print(f"Capturing image for: {board}")
139141
bsp_test_image(board, test_name, "")

examples/display/pytest_display.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@
2020
@pytest.mark.m5stack_core_s3
2121
@pytest.mark.m5stack_core_s3_se
2222
@pytest.mark.m5_atom_s3
23-
def test_display_example(dut: Dut) -> None:
23+
def test_display_example(dut: Dut, bsp_test_capture_image) -> None:
2424
dut.expect_exact('example: Display LVGL animation')
2525
dut.expect_exact('main_task: Returned from app_main()')

examples/display_lvgl_demos/pytest_display_lvgl_demos.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
@pytest.mark.m5dial
1414
@pytest.mark.m5stack_core_s3
1515
@pytest.mark.m5stack_core_s3_se
16-
def test_display_example(dut: Dut) -> None:
16+
def test_display_example(dut: Dut, bsp_test_capture_image) -> None:
1717
dut.expect_exact('app_main: Display LVGL demo')
1818
dut.expect_exact('main_task: Returned from app_main()')

0 commit comments

Comments
 (0)