[TIP] Unit testing your subclasses

Ryan Freckleton ryan.freckleton at gmail.com
Tue Sep 2 20:53:08 PDT 2008


Considering that inner classese are relatively rare in python, I'd go for
the inner-classes being tested in the main class's unit test. If the user
doesn't want the inner class tested, she can just delete the stubs.

On Fri, Aug 29, 2008 at 12:21 AM, Paul Hildebrandt <
Paul.Hildebrandt at disneyanimation.com> wrote:

> You're right, I should have said inner classes.
>
> Jonathan Lange wrote:
> > On Fri, Aug 29, 2008 at 4:08 PM, Paul Hildebrandt
> > <Paul.Hildebrandt at disneyanimation.com> wrote:
> >
> >> Michal and I were musing on how to handle unit testing subclasses in
> >> pythoscope (http://pythoscope.org).  We were thinking about them in two
> >> ways.
> >> 1. They are internal to the class and some people may not want them
> tested.
> >> 2. They should be treated like a method in that they will be tested in
> >> the main classes unit test.
> >>
> >>
> >
> > It sounds like you are talking about inner classes, not subclasses.
> >
> > Do you mean:
> >
> > class Foo:
> >     "a thing"
> >
> > class Bar(Foo):
> >     "a subthing"
> >
> > or:
> >
> > class Foo:
> >     "a foo"
> >
> >     class Bar:
> >         "a bar in a foo"
> >
> > ?
> >
> > jml
> >
>
>
> _______________________________________________
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
> http://lists.idyll.org/listinfo/testing-in-python
>



-- 
=====
--Ryan E. Freckleton
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.idyll.org/pipermail/testing-in-python/attachments/20080902/e5384f17/attachment.htm 


More information about the testing-in-python mailing list