Streamlit gives numpy deprecation warning with pytest

Ive found that when using pytest for unit testing, simply importing streamlit will throw the following warning:

PendingDeprecationWarning: the matrix subclass is not the recommended way to represent matrices or deal with linear algebra (see https://docs.scipy.org/doc/numpy/user/numpy-for-matlab-users.html). Please adjust your code to use regular ndarray.
    numpy.matrix(range(0)), numpy.ma.masked_array([])):

Ive found this is true for pytest 7.1.1 as well as pytest 8.0.0 and on the streamlit side, this is true for streamlit 1.2.0 and streamlit 1.8.1

This can easily be reproduced by creating a file named test_st.py that contains import streamlit and running pytest on the command line.

Maybe Im missing something or something is going wrong on my end? This is a bit annoying in unit testing though. If I am missing something, tips would be appreciated

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.