[TIP] Unit testing your subclasses

Jonathan Lange jml at mumak.net
Thu Aug 28 23:15:32 PDT 2008


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



More information about the testing-in-python mailing list