#14442 closed Uncategorized (wontfix)
During tests parse fixtures using setUpClass
Reported by: | Alex Gaynor | Owned by: | Alex Gaynor |
---|---|---|---|
Component: | Testing framework | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Now that we can do class level setup we should move most of the stuff (but particularly parsing of fixtures) into setUpClass.
Attachments (1)
Change History (7)
comment:1 by , 14 years ago
Component: | Uncategorized → Testing framework |
---|---|
Owner: | changed from | to
Status: | new → assigned |
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 14 years ago
Version: | 1.2 → SVN |
---|
by , 14 years ago
Attachment: | t14442.diff added |
---|
comment:3 by , 14 years ago
Resolution: | → wontfix |
---|---|
Status: | assigned → closed |
Wontfixing on the grounds that it's non-trivial and the observed gain is tiny.
comment:4 by , 12 years ago
Easy pickings: | unset |
---|---|
Severity: | → Normal |
Type: | → Uncategorized |
UI/UX: | unset |
I have a use case where I have a bunch of tests that never modify the data created in setUp(). They are also very heavy because they use a search index which is built from the database data. I would like to use setUpClass() to set up my test data and do the indexing updating, and tearDownClass() to wipe it. Fixtures in this case do not get loaded, as implied by the bug summary. I don't know if this is a sufficiently compelling case. The unittest module docs seem to imply that class and module fixtures aren't very bad.
comment:5 by , 9 years ago
It seems a shame this was marked 'wontfix' on the basis that it makes minimal difference to Django's own test suite... this would be useful for framework users' own test suites
comment:6 by , 9 years ago
In Django 1.8 this is fixed in TestCase by d89f56dc4d03f6bf6602536b8b62602ec0d46d2f.
Patch implements the outlines strategy, 25% gain on admin_views, negligible of the full test run. 6 failing tests.