[Pharo-dev] Abstract test classes are not managed well in SUnit

Cyril Ferlicot D. cyril.ferlicot at gmail.com
Sat Jun 3 20:50:31 EDT 2017


Le 04/06/2017 à 02:26, monty a écrit :
> I've seen this before, and I'm not sure it's a bug.
> 
> A testless, non-abstract subclass of a TestCase is useless unless it inherits test methods. But if it defines its own test methods, then it isn't clear if it was made a subclass to inherit test methods, or if it was made a subclass to inherit non-test helper methods, or both. I think to be safe it assumes the second.
> 
> Implement #shouldInheritSelectors in the superclass to get your intended behavior.
> 
> 

I think that in most case we want the tests from the superclass. At
least this is what I expect.

A subclass of an object keep the behaviour of its superclass when the
methods are not overridden. Why should it be different for tests?

I see your point but if that is the case I think it should inherit the
tests by default and we could had a way to prevent this behaviour in
some cases.

It is very awkward to get less tests after adding a new test in a class.
I think it reduce the power of the tests.

-- 
Cyril Ferlicot
https://ferlicot.fr

http://www.synectique.eu
2 rue Jacques Prévert 01,
59650 Villeneuve d'ascq France

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20170604/0ad79d73/attachment.asc>


More information about the Pharo-dev mailing list