gabrielfalcao / lettuce

Behavior-driven-development tool for python, inspired by Cucumber for Ruby ⛺
http://lettuce.it
GNU General Public License v3.0
1.27k stars 325 forks source link

Add --keepdb parameter passing to Django test runner #538

Closed lnagel closed 4 years ago

lnagel commented 7 years ago

In our use case, we use Lettuce together with Django test runner's test database functions. We would like to re-use the test database between test runs, because it simply takes too much time to re-create it every time with running the migrations the tests are launched. Also in our CI server, we initialize the test database before calling Lettuce from a previously exported database dump file to speed up the run.

We have added the --keepdb parameter to prevent Lettuce from dropping the test database on each test run when used together with the --test-server parameter. The --keepdb parameter value is passed on directly to Django's own test runner which handles it accordingly.