Opened 18 years ago

Closed 18 years ago

#3253 closed enhancement (fixed)

[patch] runtests.py should exit with nonzero status for failure or error

Reported by: mir@… Owned by: Adrian Holovaty
Component: Testing framework Version:
Severity: normal Keywords:
Cc: 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

I propose to change the testing system so that for failures, runtests.py or manage.py test return with status code 1 in case of failures. This makes it easier to use the test system automatically.

The attached patch makes django.test.simple.run_tests return the number of failures and uses this return value in runtests.py and manage.py test.

Since I use the test system only for django itself, I didn't check whether it actually works for manage.py test.

Attachments (2)

runtests.diff (3.6 KB ) - added by mir@… 18 years ago.
the patch
test_errors.diff (345 bytes ) - added by paulegan@… 18 years ago.
Return value should count errors as well as failures

Download all attachments as: .zip

Change History (9)

by mir@…, 18 years ago

Attachment: runtests.diff added

the patch

comment:1 by mir@…, 18 years ago

Type: defectenhancement

comment:2 by Simon G. <dev@…>, 18 years ago

Triage Stage: UnreviewedDesign decision needed

comment:3 by anonymous, 18 years ago

Triage Stage: Design decision neededReady for checkin

#3576 is a duplicate (without patch) that has been promoted to Accepted, so I promote this one.

comment:4 by mir@…, 18 years ago

Last one was me.

comment:5 by Russell Keith-Magee, 18 years ago

Resolution: fixed
Status: newclosed

(In [4608]) Fixed #3253 -- Exposed the number of failed tests as a return code in manage.py and runtests.py.

by paulegan@…, 18 years ago

Attachment: test_errors.diff added

Return value should count errors as well as failures

comment:6 by paulegan@…, 18 years ago

Resolution: fixed
Status: closedreopened
Summary: [patch] runtests.py should exit with nonzero status for failures[patch] runtests.py should exit with nonzero status for failure or error

Test run does not exit status >0 on error.

See attachment:test_errors.diff

comment:7 by Russell Keith-Magee, 18 years ago

Resolution: fixed
Status: reopenedclosed

(In [4850]) Fixed #3253 -- Included test errors in the return code.

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