[Python-ideas] unittest: 0 tests pass means failure of the testsuite
Serhiy Storchaka
storchaka at gmail.com
Thu Mar 7 00:14:33 EST 2019
06.03.19 22:12, Matěj Cepl пише:
> I am a lead maintainer of Python packages in OpenSUSE and I can
> see the pattern of many packagers adding blindly
>
> python setup.py test
>
> to %check section of our SPEC file. The problem is that if the
> package doesn't use unittest (it actually uses nose, pytest or
> something), it could lead to zero found tests, which pass and
> Python returns exit code 0 (success) even though nothing has been
> tested. It seems from the outside that everything is all right,
> package is being tested on every build, but actually it is lie.
>
> Would it be possible to change unittest runner, so that when 0
> tests pass, whole test suite would end up failing?
There was a related issue: https://bugs.python.org/issue34279.
It may be worth to make that warning more visible. Or make just setup.py
more pedantic.
More information about the Python-ideas
mailing list