I agree with you, and I would rather subclasses inherit tests by default, but 
be aware that this isn't a bug[1], and changing it will temporarily break some 
test hierarchies.

[1] 
https://github.com/pharo-project/pharo/blob/08fdc8d1712f91b2c22d95349cdf73f83eac66e1/src/SUnit-Core.package/TestCase.class/class/shouldInheritSelectors.st

> Sent: Saturday, June 03, 2017 at 8:50 PM
> From: "Cyril Ferlicot D." <cyril.ferli...@gmail.com>
> To: pharo-dev@lists.pharo.org
> Subject: Re: [Pharo-dev] Abstract test classes are not managed well in SUnit
>
> 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
> 
>

Reply via email to