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 Peter de Blanc
Recipients Peter de Blanc, ezio.melotti, michael.foord, rbcollins
Date 2019-04-09.05:40:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1554788435.05.0.183130492369.issue36569@roundup.psfhosted.org>
In-reply-to
Content
According to unittest docs: https://docs.python.org/3.7/library/unittest.html#module-unittest

`setUpClass is called with the class as the only argument and must be decorated as a classmethod()`

and:

`tearDownClass is called with the class as the only argument and must be decorated as a classmethod()`

However, I was able to create a passing test case where `setUpClass` and `tearDownClass` are decorated with `@staticmethod` instead of `@classmethod`:

I tested this with Python versions 3.6.4 and 3.7.1.

Please update the documentation to indicate that `@staticmethod` is allowed here, or else indicate why it's bad.
History
Date User Action Args
2019-04-09 05:40:35Peter de Blancsetrecipients: + Peter de Blanc, rbcollins, ezio.melotti, michael.foord
2019-04-09 05:40:35Peter de Blancsetmessageid: <1554788435.05.0.183130492369.issue36569@roundup.psfhosted.org>
2019-04-09 05:40:34Peter de Blanclinkissue36569 messages
2019-04-09 05:40:34Peter de Blanccreate