Opened 5 years ago

Closed 5 years ago

Last modified 7 weeks ago

#14442 closed Uncategorized (wontfix)

During tests parse fixtures using setUpClass

Reported by: Alex Owned by: Alex
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 5 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 5 years ago by Alex

  • Component changed from Uncategorized to Testing framework
  • Needs documentation unset
  • Needs tests unset
  • Owner changed from nobody to Alex
  • Patch needs improvement unset
  • Status changed from new to assigned
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 5 years ago by Alex

  • Version changed from 1.2 to SVN

Changed 5 years ago by Alex

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

comment:3 Changed 5 years ago by Alex

  • Resolution set to wontfix
  • Status changed from assigned to closed

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

comment:4 Changed 3 years ago by for_d

  • Easy pickings unset
  • Severity set to Normal
  • Type set to 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 7 weeks 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