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

documention request: example for postgresql_nooproc usage #348

Closed
lmilbaum opened this issue Nov 14, 2020 · 10 comments · Fixed by #421
Closed

documention request: example for postgresql_nooproc usage #348

lmilbaum opened this issue Nov 14, 2020 · 10 comments · Fixed by #421

Comments

@lmilbaum
Copy link

postgresql container spinned with docker-compose.
Invoking query and asserting the result

Didn't find a complete example/code snippet which does something similar.
Would appreciate a code example.

@fizyk
Copy link
Member

fizyk commented Nov 19, 2020

the warehouse ( https://github.com/pypa/warehouse ) project uses this kid of setup - at least used, last time I checked. It wasn't full use, but they used DatabaseJanitor part to clean the database.

Basically, whther you use docker-compose, or just run postgres through docker, you need to run it before tests and make sure you pass connection configuration to the pytest.

@fizyk
Copy link
Member

fizyk commented Nov 19, 2020

Not sure when I'll find the time, but eventually I'll think of something to write

@bkircher
Copy link

bkircher commented Jan 4, 2021

Hey there. Yes https://github.com/pypa/warehouse is a good starting point.

I could also write something up that uses pytest fixture with

from pytest_postgresql.factories import DatabaseJanitor, get_config

for testing a Flask app both, locally and in a GitLab pipeline.

Any particular good place I would put this in?

@fizyk
Copy link
Member

fizyk commented Feb 23, 2021

@bkircher Sorry for late response. A section "examples" at the end of readme maybe?

@jschaeff
Copy link
Contributor

jschaeff commented Mar 4, 2021

Hi,
I found a typo in the doc.
It says postgresql_nooproc everywhere, but it's actualy postgresql_noproc in the code.

@fizyk
Copy link
Member

fizyk commented Mar 4, 2021

@jschaeff if you'd have a bit of time to fix it I'd gladly merge it

fizyk added a commit that referenced this issue Apr 21, 2021
Add documentation example section - refs #348
@fizyk
Copy link
Member

fizyk commented Apr 21, 2021

Please check readme's example section now

@fizyk fizyk closed this as completed Apr 21, 2021
@tl24
Copy link
Contributor

tl24 commented May 5, 2021

FYI, this turned out to be a breaking change between 2.x and 3.0

@fizyk
Copy link
Member

fizyk commented May 5, 2021

@tl24 the fixture name? Sorry, I must have overlook the lack of note, when that change got introduces. Could you create a pr adding that to changes? For the future?

@tl24
Copy link
Contributor

tl24 commented May 14, 2021

Ok, I added the pull request #421

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

Successfully merging a pull request may close this issue.

5 participants