[issue37262] Make unittest assertions staticmethods/classmethods

Pascal Chambon report at bugs.python.org
Thu Jun 13 03:15:04 EDT 2019


New submission from Pascal Chambon <chambon.pascal at gmail.com>:

Is there any reasons why assertXXX methods in TestCase are instance methods and not staticmethods/classmethods?

Since they (to my knowledge) don't need to access an instance dict, they could be turned into instance-less methods, and thus be usable from other testing frameworks (like pytest, for those who want to use all the power of fixtures and yet benefit from advanced assertions, like Django's TestCase's assertXXX).

Am I missing something here?

----------
components: Tests
messages: 345463
nosy: pakal
priority: normal
severity: normal
status: open
title: Make unittest assertions staticmethods/classmethods
type: enhancement
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37262>
_______________________________________


More information about the Python-bugs-list mailing list