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 vrpolakatcisco
Recipients docs@python, vrpolakatcisco
Date 2019-04-12.12:09:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1555070993.71.0.91547720267.issue36612@roundup.psfhosted.org>
In-reply-to
Content
One particular paragraph from unittest.rst is not clear enough:

"If you want the setUpClass and tearDownClass on base classes called then you must call up to them yourself. The implementations in TestCase are empty."

It has sparkled a debate here [0].

Example:
A class SuperTestCase, which inherits from unittest.TestCase, defines some non-trivial setUpClass class method. Then a class SubTestCase, which inherits from SuperTestCase, wants to have SuperTestCase.setUpClass executed as its setUpClass.
Does SubTestCase need to override setUpClass just to call SuperTestCase.setUpClass (as the paragraphs might suggest), or can it rely in inheritance to have it executed without overriding?

I will create GitHub PR soon.

[0] https://gerrit.fd.io/r/#/c/18579/1/test/test_sparse_vec.py@14
History
Date User Action Args
2019-04-12 12:09:53vrpolakatciscosetrecipients: + vrpolakatcisco, docs@python
2019-04-12 12:09:53vrpolakatciscosetmessageid: <1555070993.71.0.91547720267.issue36612@roundup.psfhosted.org>
2019-04-12 12:09:53vrpolakatciscolinkissue36612 messages
2019-04-12 12:09:53vrpolakatciscocreate