Brian Jones <bkjo...@gmail.com> added the comment:

I can't find a previous discussion of this topic. If you know the list it 
happened on, or the bug#, let me know as I'd be curious to see the discussion. 

While I could concede that checking type is arguably a more common case than 
checking ancestry, I think that checks like assertIsSubclass have a lot of 
value. 

First, if you view your collection of unit tests as pools of change detectors, 
this type of check is very valuable in order to detect changes in ancestry that 
result from a refactoring. 

Second, if you use a test-driven style of development, this is a very 
convenient method to have as your tests and code evolve, because the amount of 
code you have to write to create a failing test becomes a one-liner. 

As an aside, I *would* like to see the submitted patch provide more detail upon 
failure. Namely, if X is not a subclass of Y, it would be nice to know what it 
*is* a subclass of in the resulting output.

----------
nosy: +Brian.Jones
status: pending -> open

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue14819>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to