This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Naitree Zhu
Recipients Naitree Zhu, steven.daprano, zach.ware
Date 2018-09-06.14:58:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1536245932.88.0.56676864532.issue34596@psf.upfronthosting.co.za>
In-reply-to
Content
What would be a good default reason? How about the function name?

    if isinstance(reason, types.FunctionType):
        reason = reason.__name__

For example,

    from unittest import TestCase, skip

    class Test(TestCase):

        @skip
        def test_bad_skip(self):
            self.assertFalse(1.0)

        @skip('always skipped')
        def test_good_skip(self):
            self.assertFalse(1.0)

$ python -m unittest -v test.py 
test_bad_skip (test.Test) ... skipped 'test_bad_skip'
test_good_skip (test.Test) ... skipped 'always skipped'

----------------------------------------------------------------------
Ran 2 tests in 0.000s

OK (skipped=2)


But this wouldn't be very helpful if test method is a lambda (just saying...)
History
Date User Action Args
2018-09-06 14:58:52Naitree Zhusetrecipients: + Naitree Zhu, steven.daprano, zach.ware
2018-09-06 14:58:52Naitree Zhusetmessageid: <1536245932.88.0.56676864532.issue34596@psf.upfronthosting.co.za>
2018-09-06 14:58:52Naitree Zhulinkissue34596 messages
2018-09-06 14:58:52Naitree Zhucreate