Opened 8 years ago

Closed 8 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 Ana Balica, 8 years ago

Owner: changed from nobody to Ana Balica

comment:2 by Tim Graham, 8 years ago

Summary: Test command sys.exit() does unnecessary casting to False alwaysTest command sys.exit() does unnecessary casting
Triage Stage: UnreviewedReady for checkin

comment:3 by Tim Graham <timograham@…>, 8 years ago

Resolution: fixed
Status: assignedclosed

In bafc9f9c:

Fixed #27423 -- Simplified sys.exit() for indicating test failures.

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