[TIP] Problem with mock

Ken Hagler khagler at orange-road.com
Thu Dec 20 18:30:05 PST 2012


On Dec 20, 2012, at 2:10 PM, Julian Berman <julian at grayvines.com> wrote:

> So, your error says your object doesn't have a config attr because it
> doesn't. All you've done is mocked super so that it returns a mock object,
> but that object is not really the superclass of DevBuild, and DevBuild
> never runs Build.__init__, and never sets its own config object.

Yes, the idea was that the mock object was supposed to have a config object

> So, if you want to have a config attr, you have to set it, presumably to a
> mock object 

Okay, how? If mocking super is useless, than how to I get that to happen?
-- 
                              Ken Hagler

|                   http://www.orange-road.com/                   |
|   And tho' we are not now that strength which in old days       |
|   Moved earth and heaven, that which we are, we are --Tennyson  |




More information about the testing-in-python mailing list