Skip to content

Is it possible to prompt the user to do something during py.test runs? #4210

Closed
@GlenNicholls

Description

@GlenNicholls

I am going to be writing a full system test for our customer to be able to check all of our systems during configuration after unit tests pass to ensure everything is working properly. For unit testing the code, py.test works great. However, we have a PCB that provides critical information during testing and need to be able to prompt the user to perform certain tasks so that the system can check these conditions to ensure they are as expected. Here is a simple example of what I am trying to do in a test function/class:

def test_pcb_button()
    print('press the button') # or something similar to print in py.test to force it to console
    print('does the led turn on? [y/n]')
    assert user_input() == 'y'

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: questiongeneral question, might be closed after 2 weeks of inactivity

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions