[issue41046] unittest: make skipTest a classmethod

2021-08-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Since you always can raise a SkipTest in setUpClass() and setUpModule() and changing skipTest() can break existing code (for example the code which calls cls.skipTest(None, reason) for some strange reasons), I think that it is not worth to change it.

[issue41046] unittest: make skipTest a classmethod

2020-07-28 Thread James Corbett
James Corbett added the comment: I was careless in my example, it would need to be `cls.skipTest(reason)`. However, that really doesn't have anything to do with why it should be a `classmethod` instead of an instance method: it's so that you can call `skipTest` from `classmethods`, namely

[issue41046] unittest: make skipTest a classmethod

2020-06-29 Thread Andrei Daraschenka
Andrei Daraschenka added the comment: Hello and thanks for your issue. Can you explain why we need to make method as `classmethod` because in your example you don't provide argument for `cls.skipTest()`. -- nosy: +dorosch ___ Python tracker

[issue41046] unittest: make skipTest a classmethod

2020-06-19 Thread James Corbett
Change by James Corbett : -- keywords: +patch pull_requests: +20171 stage: -> patch review pull_request: https://github.com/python/cpython/pull/20996 ___ Python tracker ___

[issue41046] unittest: make skipTest a classmethod

2020-06-19 Thread James Corbett
New submission from James Corbett : The `unittest.TestCase.skipTest` method, used to skip the current test, is currently an instance method. There's nothing to stop it from being a `classmethod` or a `staticmethod` though---it doesn't use its reference to `self` since it's just a wrapper