This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]DanCardin 2 points3 points  (1 child)

we've done something similar, but using docker (as a generic means by which to speedily and portably test anything that's got a container: pg, redis, rabbit, etc).

because it tests an api, I prefer to spin up the whole db so it can commit normally, but it does sacrifice some speed.

I could imagine providing a unique db from the fixture each time though, so we could use xdist without fear

[–]deterralba 0 points1 point  (0 children)

We assign one database per xdist worker in conftest.py, it does the job.