-
Notifications
You must be signed in to change notification settings - Fork 345
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
New release #317
Comments
Does --reuse-db not work for you? |
It does until a new migration is added; then you need to explicitly drop the
This drawback of Just in case it wasn't clear, I think this change was already made in the PR I mentioned (to have |
Thanks for your explanation. Although I've added the change myself, I was not aware of it's benefits.. :) Apart from that a new release would be nice to have anyway. |
|
I see. For this you could have pytest fixtures instead / additionally: the fixture would either use the data from the DB/migration or create it to be available for the tests. |
Yes, and that's roughly what I did pre-1.7 when it was tougher to integrate migrations into the test cycle. But that meant duplicating the code for making the relevant database changes, and introduced a risk that you're testing something which doesn't quite match what you're actually applying in the migrations for real installations. |
Yeah. Thanks for elaborating again. @pelme |
I will try to put out a new release in the next couple of days. I would like to test this change out with my project properly (I use --reuse-db quite extensively). Btw, I also have problems with slow CI builds because of migrations and would like to improve things further:
|
For what it's worth, you could also use something like this to skip Travis builds for migration tests (instead of the md5 hash):
|
btw: https://github.com/fastmonkeys/stellar is really nice in this regard, too: it creates DB snapshots. |
I've just tried using master (with the
Maybe related to using The hopefully relevant part of the traceback:
|
Ok, for clarification: |
@blueyed did you run tests without |
@sasha0 Anyway, the issue itself is fixed: there's a 3.0 release now.. 🎉 |
The
--keepdb
fix from #261 looks like it'll save about 4-7 minutes on each test run of a project I'm working on (depending on hardware); is there a timeline yet for a new pytest-django release which would include it? I don't see any issues currently tagged as release blockers.The text was updated successfully, but these errors were encountered: