You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to write a pytest test that checks whether the app starts sucessfully, then ends it after a while. The test should also pass if there is no graphical user interface available (e.g. GitHub CI).
My first attempt was not successful. The app is not terminated and the test runs forever.
deftest_app_starts_and_quits():
# Start the app processapp_process=subprocess.Popen(["python", "app/app.py"])
# Wait for a few seconds to let the app starttime.sleep(3)
# Verify the process is still runningassertapp_process.poll() isNone# Terminate the app processapp_process.terminate()
# Wait for the process to endapp_process.wait()
# Verify the process has endedassertapp_process.returncodeisnotNone
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to write a
pytest
test that checks whether the app starts sucessfully, then ends it after a while. The test should also pass if there is no graphical user interface available (e.g. GitHub CI).My first attempt was not successful. The app is not terminated and the test runs forever.
Beta Was this translation helpful? Give feedback.
All reactions