Running testr with --subunit option always returns 0
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Testrepository |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Consider the following test suite:
import unittest
class Test(unittest.
def test_case1(self):
def test_case2(self):
def test_case3(self):
def test_case4(self):
def test_case5(self):
.testr.conf:
[DEFAULT]
test_command=python -m subunit.run discover . $LISTOPT $IDOPTION
test_id_
test_list_
Running tests with "testr run" works great:
rpodolyaka@
(venv)rpodolyak
1
The process exit code is 1, because the test suite failed, and this was expected.
However, when --subunit option is used, the exit code is always 0, even if some tests fail:
(venv)rpodolyak
(venv)rpodolyak
0
This is deliberate, because it's up to the subunit consumer to decide success/fail, as long as the stream was successfully generated.