I'm trying to learn more about your test flow with Django.
Background information
IM tests face difficulties while using development. When Test Runner of the Django starts continuously, all DB models in Test DB form. For our current projects (between 40 and 240 models) it means that it takes 20S easily to start the trial.
This often makes it completely ineffective to test a new feature. My question is, how do you guys work about it?
I have tried a few things in the past few days.) - Change the testloader to reuse one test DB every time and apply migration if necessary. ) - Run my unit test from within __ main___
of python files
option is odd with sys.path, one option is possible, but this is the default way .
Update: Option A is not really such a bad solution. It is a bit of a lot of effort which I believe that people use a different solution, SQL Light can be the solution but Im It is estimated that the same happens more often.
To change the testloader each time to reuse a single Test DB and when Migration applies if necessary.
I do not think anything wrong in writing my own test runner, instead of leaving the database and creating a database, Leaves this drug in which it solves a specific problem. One is open to allow the sampling of test case in test suites, after it is fixed, you should be able to group your test cases in the suite for easy management. You can also inspect the patch attached to the ticket and see if it is consistent with your purpose.
As you can use in a memory database it depends largely on being portable depending on your data model and queries.
If you have not already tried to reconstruct your test cases, all test classes in my experience will be sub category
django.test.TestCase
is not required. Find those test squares that can be done with sub classificationunittest.TestCase
. This will speed things up small bit.Move the organized fixtures to the common fixtures in a single file and using each test class (using
fixtures = [...]
) Instead, load it before running the test.
Comments
Post a Comment