Opened 6 years ago
Last modified 6 years ago
#29658 closed Cleanup/optimization
Use unittest.addCleanup to unregister lookups. — at Initial Version
Reported by: | Mads Jensen | Owned by: | nobody |
---|---|---|---|
Component: | Core (Other) | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
There are some places in the test suite that follow this pattern:
try: CharField.register_lookup(Length) # some test code finally: CharField._unregister_lookup(Length)
It'd be better to use unittest.addCleanup
to handle this stuff.
Note:
See TracTickets
for help on using tickets.