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

2011-12-18 Thread Roundup Robot
Roundup Robot added the comment: New changeset 6a95820b9607 by Antoine Pitrou in branch '2.7': Followup to #7502: add __hash__ method and tests. http://hg.python.org/cpython/rev/6a95820b9607 -- ___ Python tracker _

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

2011-12-18 Thread Cédric Krier
Cédric Krier added the comment: Add test for __hash__ -- Added file: http://bugs.python.org/file24040/issue7502-hash.patch ___ Python tracker ___

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

2011-12-18 Thread Cédric Krier
Cédric Krier added the comment: Patch to add __hash__ to prevent warnings in 2.7 -- Added file: http://bugs.python.org/file24039/issue7502-hash.patch ___ Python tracker ___ _

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

2011-12-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: Patch now committed to all 3 branches. Thanks for contributing! -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker ___

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

2011-12-18 Thread Roundup Robot
Roundup Robot added the comment: New changeset c478734ded4b by Antoine Pitrou in branch '3.2': Issue #7502: Fix equality comparison for DocTestCase instances. http://hg.python.org/cpython/rev/c478734ded4b New changeset b8cb6f1e4981 by Antoine Pitrou in branch 'default': Issue #7502: Fix equalit

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

2011-12-18 Thread Cédric Krier
Cédric Krier added the comment: Add also __eq__ to Example and add __ne__ method. -- Added file: http://bugs.python.org/file24036/issue7502.patch ___ Python tracker ___ _

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

2011-12-18 Thread Cédric Krier
Cédric Krier added the comment: Add test for "!=" -- Added file: http://bugs.python.org/file24033/issue7502.patch ___ Python tracker ___ _

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

2011-12-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: Something I forgot: you should also test the "!=" operator in the tests. -- ___ Python tracker ___ _

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

2011-12-18 Thread Cédric Krier
Cédric Krier added the comment: Update patch to not use hash in __eq__ -- Added file: http://bugs.python.org/file24031/issue7502.patch ___ Python tracker ___

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

2011-12-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: The definition of __eq__ is wrong: it shouldn't compare the hashes since the hash() function isn't injective. For example, 0 and "" have equal hashes, yet they are unequal. -- ___ Python tracker

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

2011-12-18 Thread Cédric Krier
Cédric Krier added the comment: New patch to add __hash__ and __eq__ to DocTest -- Added file: http://bugs.python.org/file24029/issue7502.patch ___ Python tracker ___ ___

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

2011-12-18 Thread Cédric Krier
Cédric Krier added the comment: New patch with test -- Added file: http://bugs.python.org/file24028/issue7502.patch ___ Python tracker ___ ___

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

2011-12-15 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyt

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

2011-01-30 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- stage: needs patch -> patch review versions: +Python 3.3 -Python 2.6, Python 3.1 ___ Python tracker ___

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

2011-01-30 Thread Cédric Krier
Cédric Krier added the comment: Here is a patch that defines __eq__ and __hash__ on DocTestCase. -- keywords: +patch nosy: +ced Added file: http://bugs.python.org/file20618/doctestcase_eq_hash.patch ___ Python tracker

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

2009-12-14 Thread Michael Foord
Michael Foord added the comment: Agreed, defining __eq__ and __hash__ on DocTestCase sounds like the way to go. -- ___ Python tracker ___

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

2009-12-14 Thread Jean-Paul Calderone
Jean-Paul Calderone 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

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

2009-12-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: There doesn't seem to be an __eq__ or __cmp__ method in DocTestCase, which implies that the issue is with unittest.TestCase (from which DocTestCase inherits). -- nosy: +michael.foord, pitrou priority: -> normal stage: -> needs patch versions: +Python

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

2009-12-13 Thread Jean-Paul Calderone
New submission from Jean-Paul Calderone : 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(twist