[TIP] testfixtures and mock

Chris Withers chris at simplistix.co.uk
Mon Aug 13 02:32:07 PDT 2012

Hi Ben,

On 13/08/2012 10:22, Ben Finney wrote:
> How much feature overlap do you see between the current versions of the
> ‘textfixtures’ and ‘mock’ libraries?

I'm sure there's some overlap, but the only one I'm aware of it mock's 
patch versus testfixtures' replace. I prefer replace (obviously ;-) ) 
with its ability to work on dictionary keys, class and object attributes 
as well as strict and non-strict replacement...

> How well do they work together (as
> distinct from merely co-existing)?

...but I use Mock heavily, so I think they work pretty well together. I 
frequently use Mock objects with replace.

That said, testfixtures has a load of other stuff, most notably 
LogCapture and TempDirectory...



Simplistix - Content Management, Batch Processing & Python Consulting
             - http://www.simplistix.co.uk

More information about the testing-in-python mailing list