Opened 9 years ago
Closed 9 years ago
#27423 closed Cleanup/optimization (fixed)
Test command sys.exit() does unnecessary casting
| Reported by: | Ana Balica | Owned by: | Ana Balica |
|---|---|---|---|
| Component: | Testing framework | Version: | 1.10 |
| Severity: | Normal | Keywords: | test |
| 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
Currently we have:
if failures:
sys.exit(bool(failures))
If no failures, the script will exit with 0 success, if any failures, then the exit is forced with a False value, which will result in a 1.
Why not be explicit?
if failures:
sys.exit(1)
Change History (3)
comment:1 by , 9 years ago
| Owner: | changed from to |
|---|
comment:2 by , 9 years ago
| Summary: | Test command sys.exit() does unnecessary casting to False always → Test command sys.exit() does unnecessary casting |
|---|---|
| Triage Stage: | Unreviewed → Ready for checkin |
comment:3 by , 9 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
In bafc9f9c: