Author Naitree Zhu
Recipients Naitree Zhu
Date 2018-09-06.13:05:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
When using @skip decorator, `reason` argument is required. But one could easily overlook that and use it like so:

    class SomeTest(TestCase):

        def test_method(self):
            # ...

The test actually passes when running with unittest, because it's equivalent to

    class SomeTest(TestCase):

        def test_method(self):
            # ...
        test_method = skip(test_method)

This gives the illusion that @skip decorator worked as expected.

I propose we should check the passed in `reason`, and raise error if it looks like a function/method, therefore prevent this erroneous usage.

In practice, this behavior has misled people using the decorator in the unintended way. For example: In this chapter of Test-Driven Development with Python (, the author used @skip decorator without `reason` argument.
Date User Action Args
2018-09-06 13:05:21Naitree Zhusetrecipients: + Naitree Zhu
2018-09-06 13:05:21Naitree Zhusetmessageid: <>
2018-09-06 13:05:21Naitree Zhulinkissue34596 messages
2018-09-06 13:05:20Naitree Zhucreate