[openstack-dev] [nova] Do we have some guidelines for mock, stub, mox when writing unit test?

Mark McLoughlin markmc at redhat.com
Mon Nov 11 23:18:09 UTC 2013


On Mon, 2013-11-11 at 12:07 +0000, John Garbutt wrote:
> On 11 November 2013 10:27, Rosa, Andrea (HP Cloud Services)
> <andrea.rosa at hp.com> wrote:
> > Hi
> >
> >>Generally mock is supposed to be used over mox now for python 3 support.
> >
> > That is my understanding too
> 
> +1
> 
> But I don't think we should waste all our time re-writing all our mox
> and stub tests. Lets just leave this to happen organically for now as
> we add and refactor tests. We probably need to take the hit at some
> point, but that doesn't feel like we should do that right now.

Hmm, I don't follow this stance.

Adding Python3 support is a goal we all share.

If we're saying that the use of mox stands in the way of that goal, but
that we'd really prefer if people didn't work on porting tests from mox
to mock yet ... then are we saying we don't value people working on
porting to Python3?

And if we plan to use a Python3 compatible version of mox[1], then isn't
the Python3 argument irrelevant and saying "use mock for new tests" just
means we'll end up with a mixture of mox and mock?

Thanks,
Mark.

[1] - https://github.com/emonty/pymox




More information about the OpenStack-dev mailing list