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'm looking at the configuration example, which seems to be an extract from _confest.py. In _conftest.py you from pytest_postgresql.factories import (init_postgresql_database, drop_postgresql_database). I'm not sure if I'm supposed to pip install pytest-postgresql myself but, in any case, I'm wondering about init_postgresql_database and drop_postgresql_database. These 2 functions are apparently deprecated in pytest-postgresql 2.1.0, released on September 10, 2019. Does the configuration example need updating or am I just off track here?
Thanks
The text was updated successfully, but these errors were encountered:
I think it is setup to connect to an already running postgres process (a process that was started outside of pytest) and initialize the database with the tables/params defined in your app. The functions provided by pytest-postgresql are not strictly necessary to use the plugin. You could alternatively spin up a postgresql process manually, create the tables, and provide the connection url. I have been doing that with an existing docker container running a postgresql process and directly providing my test app with the SQLALCHEMY_DATABASE_URI.
However, I have been trying to figure out how to create and teardown a postgresql process within pytest, I would love to hear about any examples or suggestions on how to do that.
I'm looking at the configuration example, which seems to be an extract from _confest.py. In _conftest.py you
from pytest_postgresql.factories import (init_postgresql_database, drop_postgresql_database)
. I'm not sure if I'm supposed topip install pytest-postgresql
myself but, in any case, I'm wondering aboutinit_postgresql_database
anddrop_postgresql_database
. These 2 functions are apparently deprecated in pytest-postgresql 2.1.0, released on September 10, 2019. Does the configuration example need updating or am I just off track here?Thanks
The text was updated successfully, but these errors were encountered: