Skip to content

Issues with expect? (RDT-1317) #358

@evandavey

Description

@evandavey

I am using pytest with ESP-IDF v5.4.1 to run some automated tests. My test_app is setup to just run unity_run_menu();

I want to extract the device id for a test report so I have written a test to print it. This is my pytest to first check the Device ID is printed (before I attempt to write a regex to extract it). The tests correctly upload and run, I can see the device_id test being selected and the correct device ID being output. However pytest is unable to parse the output and I just see "Enter next test, or 'enter' to see menu" in the buffer of the error message (like this was the only line expect tried to parse).

I have tried various methods for extracting the full output for parsing without success e.g. dut.read(...) as they don't seem supported.

import pytest
from pytest_embedded import Dut
import re

@pytest.mark.supported_targets
@pytest.mark.generic
def test_device_id(dut: Dut) -> None:
    dut.run_all_single_board_cases(name='device_id')
   
    # Wait for the output with a timeout
    dut.expect('Device ID:'), timeout=20)
  

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions