Testing if Streamlit run results in an error

Hello community,

Me and my team are developing some Streamlit applications to explore data and metrics from out Data Science project.
We would like to have some kind of run test of our Streamlits.
The idea is that, as our code evolves, we want to make sure from time to time that our applications can load without displaying errors such as the example below.
Capture

As some kind of test, we tried to encapsulate the main function in a try/except like below, but it seems a bit dirty.

try:
    from some_streamlit_file import main
    main()
except:
    print("This is a failure!")

Is there some kind of test code in Streamlit which help verify if a Streamlit application displays an error?