Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecated functions from pytest-posgresql? #24

Open
Jsalaz1989 opened this issue Oct 7, 2019 · 1 comment
Open

Deprecated functions from pytest-posgresql? #24

Jsalaz1989 opened this issue Oct 7, 2019 · 1 comment

Comments

@Jsalaz1989
Copy link

Jsalaz1989 commented Oct 7, 2019

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

@song-william
Copy link

song-william commented Oct 7, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants