app/
├── app.py
└── tests/
└── gui_tests/
└── test_app.py
app.py:
import streamlit as st
st.text("hello world")
test_app.py:
from streamlit.testing.v1 import AppTest
from pathlib import Path
def test_gui():
at = AppTest.from_file(Path(__file__).parents[2] / 'app.py')
at.run()
assert not at.exception
When running this with pytest I get a timeout error:
> raise RuntimeError(err_string)
E RuntimeError: AppTest script run timed out after 3(s)
I have no clue why.