Opened 6 years ago

Closed 6 years ago

Last modified 17 months ago

#14442 closed Uncategorized (wontfix)

During tests parse fixtures using setUpClass

Reported by: Alex Gaynor Owned by: Alex Gaynor
Component: Testing framework Version: master
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)

t14442.diff (19.2 KB) - added by Alex Gaynor 6 years ago.
Patch implements the outlines strategy, 25% gain on admin_views, negligible of the full test run. 6 failing tests.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 6 years ago by Alex Gaynor

Component: UncategorizedTesting framework
Owner: changed from nobody to Alex Gaynor
Status: newassigned
Triage Stage: UnreviewedAccepted

comment:2 Changed 6 years ago by Alex Gaynor

Version: 1.2SVN

Changed 6 years ago by Alex Gaynor

Attachment: t14442.diff added

Patch implements the outlines strategy, 25% gain on admin_views, negligible of the full test run. 6 failing tests.

comment:3 Changed 6 years ago by Alex Gaynor

Resolution: wontfix
Status: assignedclosed

Wontfixing on the grounds that it's non-trivial and the observed gain is tiny.

comment:4 Changed 4 years ago by for_d

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 Changed 17 months ago by anentropic

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

Note: See TracTickets for help on using tickets.
Back to Top