Which mock library do you prefer?

Ben Finney ben+python at benfinney.id.au
Mon Feb 15 19:17:13 EST 2010


Lacrima <lacrima.maxim at gmail.com> writes:

> Minimock has wider usage and community, but I have some troubles using
> it. Maybe I am wrong, but with minimock you always have to keep track
> the order of imports in your test modules. Well, may be I just don't
> understand fully how minimock works.

I'm not sure why you think you need to keep track of the order of
imports.

Simply set up the mocks as you want them, in your fixtures; then, when
tearing down your fixtures, use ‘minimock.restore()’ to restore the
affected namespaces to their initial state.

-- 
 \       “… one of the main causes of the fall of the Roman Empire was |
  `\        that, lacking zero, they had no way to indicate successful |
_o__)                  termination of their C programs.” —Robert Firth |
Ben Finney



More information about the Python-list mailing list