Author zach.ware
Recipients Naitree Zhu, steven.daprano, zach.ware
Date 2018-09-06.14:25:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
It could be interesting to enable uncalled `skip` by setting a default reason of "Unconditional skip" when the argument is a function.

Do note that decorating with an uncalled `skip` does actually work to skip the test currently, but the test is marked as success rather than skipped (see example pasted below).  For this reason, I don't think we should turn it into an error in maintenance releases, as anyone using this accidentally will suddenly have many failing tests.

$ cat
from unittest import TestCase, skip

class Test(TestCase):

    def test_good(self):

    def test_bad(self):

    def test_bad_skip(self):

    @skip('always skipped')
    def test_good_skip(self):

$ ./python.exe -m unittest -v
test_bad (test.Test) ... FAIL
test_bad_skip (test.Test) ... ok
test_good (test.Test) ... ok
test_good_skip (test.Test) ... skipped 'always skipped'

FAIL: test_bad (test.Test)
Traceback (most recent call last):
  File "/.../", line 10, in test_bad
AssertionError: 1.0 is not false

Ran 4 tests in 0.002s

FAILED (failures=1, skipped=1)
Date User Action Args
2018-09-06 14:25:26zach.waresetrecipients: + zach.ware, steven.daprano, Naitree Zhu
2018-09-06 14:25:26zach.waresetmessageid: <>
2018-09-06 14:25:26zach.warelinkissue34596 messages
2018-09-06 14:25:26zach.warecreate