[issue7502] All DocTestCase instances compare and hash equal to each other

Jean-Paul Calderone report at bugs.python.org
Mon Dec 14 23:00:14 CET 2009


Jean-Paul Calderone <exarkun at divmod.com> added the comment:

Or an interaction between TestCase and DocTestCase.  TestCase.__eq__ and
TestCase.__hash__ are both implemented in terms of the _testMethodName
attribute.  It looks like this is *always* "runTest" for a DocTestCase
instance.  It probably doesn't make sense to set a _testMethodName for
DocTestCase instances (maybe it doesn't even make sense for DocTestCase
to subclass TestCase, in fact).  So perhaps overriding comparison and
hashing to use the attributes that do make sense (_dt_test, maybe, I
don't know) would make sense.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7502>
_______________________________________


More information about the Python-bugs-list mailing list