Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#16528 closed Bug (fixed)

Error in documentation? (test runner return code)

Reported by: anonymous Owned by: teraom
Component: Documentation Version: 1.2
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

From the release docs for Django 1.2 it would look like the exit status code returned by the test runner scripts no longer represents the number of failed tests.

The exit status code of the test runners (tests/runtests.py and python manage.py test) no longer represents the number of failed tests, because a failure of 256 or more tests resulted in a wrong exit status code. The exit status code for the test runner is now 0 for success (no failing tests) and 1 for any number of test failures. If needed, the number of test failures can be found at the end of the test runner's output.

However, even in the currently existing testing documentation it is stated that the return code is the number of failed tests.

Note that the return code for the test-runner script is the total number of failed and erroneous tests. If all the tests pass, the return code is 0. This feature is useful if you're using the test-runner script in a shell script and need to test for success or failure at that level.

Provided "exit status code" and "return code" mean the same thing, this would look like an error to me.

Attachments (1)

testing-output-docs-16528.diff (683 bytes) - added by teraom 4 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 4 years ago by ramiro

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 4 years ago by teraom

  • Owner changed from nobody to teraom
  • Status changed from new to assigned

Changed 4 years ago by teraom

comment:3 Changed 4 years ago by teraom

  • Has patch set

comment:4 Changed 4 years ago by julien

  • Triage Stage changed from Accepted to Ready for checkin

comment:5 Changed 4 years ago by julien

  • Type changed from Uncategorized to Bug

comment:6 Changed 4 years ago by timo

  • Resolution set to fixed
  • Status changed from assigned to closed

In [16584]:

Fixed #16528 - Documented test runner returns 1, regardless of the number of test failures; thanks teraom.

comment:7 Changed 4 years ago by timo

In [16585]:

[1.3.X] Fixed #16528 - Documented test runner returns 1, regardless of the number of test failures; thanks teraom.

Backport of r16584 from trunk.

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