'Multiple flask calls in single pytest having different databases

So I'm trying to test an endpoint in flask that I need to call multiple times in one test. The issue I am having is that on the second request the objects I placed into the DB using pytest fixture with the scope of function do not appear in the db on that second call. Is this normal / is there a way to change this behavior? Using SqlAlchemy for ORM with a scoped_session. Thanks!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source