[New-bugs-announce] [issue7502] All DocTestCase instances compare and hash equal to each other

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


New submission from Jean-Paul Calderone <exarkun at divmod.com>:

Consider this example, based on two doctests from Twisted:

  from doctest import DocTestSuite
  import twisted.web2.stream
  docTestOne = DocTestSuite(twisted.web2.stream)._tests[0]
  import twisted.web2.test.test_stream
  docTestTwo = DocTestSuite(twisted.web2.test.test_stream)._tests[0]
  print docTestOne.id(), '==', docTestTwo.id(), '?'
  print docTestOne == docTestTwo

One might reasonably expect a false result, since the two DocTestCase
instances represent two different doctests.  One will meet with
surprise, though.

----------
components: Library (Lib)
messages: 96368
nosy: exarkun
severity: normal
status: open
title: All DocTestCase instances compare and hash equal to each other
type: behavior
versions: Python 2.6

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


More information about the New-bugs-announce mailing list