Friday, September 14, 2012

Mocking sucks! I hate mocking!

I use Mock very frequently in my unittests because I need to isolate my system under test. But I hate mocking because it always give me problems. The documentation gives made-up examples that are independent from other sections in the documentation.

Fine. I am fine with that, but why the hell do I need to use .return_value all the time in my mock object?

I am consistently biting myself with mock library and I have wasted more time on mocking my objects more than me watching a two-hour movie.

The number one thing I hate about mocking is when it returns a Mock object when I call it. Like what the fuck man? Seriously.

Here is the latest issue I have with mocking: [TIP] Mock returns a mock using autospec

If this was such an easy question people would have answer it a long time ago. Why none? Because it is so god damn hard I think!

If there was a different library to do mocking I'd go with that AS LONG AS IT IS SIMPLE TO MOCK.

No comments:

Post a Comment