[TIP] Problem with mock

Ken Hagler khagler at orange-road.com
Thu Dec 20 06:48:35 PST 2012

On Dec 19, 2012, at 2:57 PM, John Wong <gokoproject at gmail.com> wrote:

> I usually mock a class by using autospec parameter so the specs of the
> class remains except it's MOCKed.
> That allows me to just quickly mock out the class I want while keeping all
> the necessary attributes/method I need.

Reasonable, but would I use Build or DevBuild for that? I suppose I'm wary of adding another factor that I don't particularly understand when it's already not working...

> Also, the error doesn't indicate it's a mock object. If it were a mock, I
> believe you would see "MagicMock object" rather than DevBuild object.

Okay, any idea what I'm doing wrong there?
                              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