Opened 13 years ago
Closed 13 years ago
#16196 closed Cleanup/optimization (fixed)
Redundant or incorrect code in tests
Reported by: | Dmitry Jemerov | Owned by: | Stephen Burrows |
---|---|---|---|
Component: | Uncategorized | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Dmitry Jemerov | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Ran a static analysis tool on Django tests, found and fixed several classes of issues:
- Unnecessary semicolons
- Unnecessary backslashes
- Duplicate keys in dictionaries containing testdata (sometimes causing testcases present in the code to be missed)
- One case of incorrectly inserted line break preventing the execution of an assertion
Attached patch fixing the issues.
Attachments (2)
Change History (10)
by , 13 years ago
Attachment: | 16196.diff added |
---|
comment:1 by , 13 years ago
Cc: | added |
---|
comment:2 by , 13 years ago
comment:3 by , 13 years ago
Triage Stage: | Unreviewed → Accepted |
---|
Small improvements and clarification are always welcome, I think.
comment:4 by , 13 years ago
Patch needs improvement: | set |
---|
The tests for 'regroup' in tests/regressiontests/templates/tests.py
could be further simplified by taking advantage of string concatenation; most +
signs are useless.
As mentionned by nnrcschmdt, the patch should use \n and not \r\n.
If these two problems are fixed, it's ready for checkin.
comment:5 by , 13 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
by , 13 years ago
Attachment: | 16196_fixed.diff added |
---|
comment:6 by , 13 years ago
Patch needs improvement: | unset |
---|---|
Version: | 1.3 → SVN |
Made the fixes suggested by aaugustin.
comment:7 by , 13 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
patch complains about carriage return characters: "Stripping trailing CRs from patch."