[New-bugs-announce] [issue18702] Report skipped tests as skipped

Serhiy Storchaka report at bugs.python.org
Sat Aug 10 13:09:26 CEST 2013


New submission from Serhiy Storchaka:

Some tests in Python testsuite are silently skipped if requirements is not satisfied. The proposed patch adds explicit "skipUnless()" and "raise SkipTest()" so that these tests now reported as skipped.

I.e. the code like

    if not condition:
        def test_foo(self):
            ...

is replaced by

    @unittest.skipUnless(condition, "requires foo")
    def test_foo(self):
        ...

and the code like

    def test_foo(self):
        ...
        if not condition:
            return
        ...

is replaced by

    def test_foo(self):
        ...
        if not condition:
            raise unittest.SkipTest("requires foo")
        ...

----------
components: Tests
files: skip_tests.patch
keywords: patch
messages: 194790
nosy: ezio.melotti, michael.foord, pitrou, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Report skipped tests as skipped
type: enhancement
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file31213/skip_tests.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18702>
_______________________________________


More information about the New-bugs-announce mailing list