Re: [Python-Dev] incompatible unittest changes

2007-10-19 Thread Jean-Paul Calderone
On Fri, 19 Oct 2007 15:51:51 -0700, Collin Winter [EMAIL PROTECTED] wrote:
On 10/19/07, Jean-Paul Calderone [EMAIL PROTECTED] wrote:
 In trunk after 2.5, equality and hashing for TestCase were added, changing 
 the behavior so that two instances of TestCase for the same test method hash 
 the same and compare equal.  This means two instances of TestCase for the 
 same test method cannot be added to a single set.

 Here's the change:

 http://svn.python.org/view/python/trunk/Lib/unittest.py?rev=54199r1=42115r2=54199

 The implementations aren't even very good, since they prevent another type 
 from deciding that it wants to customize comparison against TestCase (or 
 TestSuite,
 or FunctionTestCase) instances.

The implementations have been changed in a more recent revision.

Not in http://svn.python.org/projects/python/trunk/Lib/[EMAIL PROTECTED]


 Is there a real use case for this functionality?  If not, I'd like it to be
 removed to restore the old behavior.

The use-case was problems I encountered when writing the test suite
for unittest. If you can find a way to implement the functionality you
want *and* keep the test suite reasonably straightforward, I'll be
happy to review your patch.

The test suite can implement the comparison which is currently on the
unittest classes and invoke that functionality instead of using == and
!=.

Jean-Paul
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] incompatible unittest changes

2007-10-19 Thread Collin Winter
On 10/19/07, Jean-Paul Calderone [EMAIL PROTECTED] wrote:
 In trunk after 2.5, equality and hashing for TestCase were added, changing 
 the behavior so that two instances of TestCase for the same test method hash 
 the same and compare equal.  This means two instances of TestCase for the 
 same test method cannot be added to a single set.

 Here's the change:

 http://svn.python.org/view/python/trunk/Lib/unittest.py?rev=54199r1=42115r2=54199

 The implementations aren't even very good, since they prevent another type 
 from deciding that it wants to customize comparison against TestCase (or 
 TestSuite,
 or FunctionTestCase) instances.

The implementations have been changed in a more recent revision.

 Is there a real use case for this functionality?  If not, I'd like it to be
 removed to restore the old behavior.

The use-case was problems I encountered when writing the test suite
for unittest. If you can find a way to implement the functionality you
want *and* keep the test suite reasonably straightforward, I'll be
happy to review your patch.

Collin Winter
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] incompatible unittest changes

2007-10-19 Thread Jean-Paul Calderone
In trunk after 2.5, equality and hashing for TestCase were added, changing the 
behavior so that two instances of TestCase for the same test method hash the 
same and compare equal.  This means two instances of TestCase for the same test 
method cannot be added to a single set.

Here's the change:

http://svn.python.org/view/python/trunk/Lib/unittest.py?rev=54199r1=42115r2=54199

The implementations aren't even very good, since they prevent another type from 
deciding that it wants to customize comparison against TestCase (or TestSuite,
or FunctionTestCase) instances.

Is there a real use case for this functionality?  If not, I'd like it to be
removed to restore the old behavior.

Jean-Paul
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com