[Twisted-Python] Adding mock as a test suite dependency

Kevin Horn kevin.horn at gmail.com
Mon Oct 22 14:14:55 EDT 2012

On Sun, Oct 21, 2012 at 10:00 PM, Glyph <glyph at twistedmatrix.com> wrote:

> On Oct 21, 2012, at 7:45 PM, Julian Berman <julian at grayvines.com> wrote:
> The *benefit* though for me in having mock present is that it decreases the
> lines of code necessary to write stubs and mocks. While doing so is not
> really
> that difficult anyhow, it *is* just a bit more clutter to do so without
> mock,
> and the extra 3 or 4 lines mean that in more than one instance I have found
> myself pick a different strategy than I would have because of the extra
> lines
> of code that clutter the test method.
> This seems like a pretty small benefit; adding a new dependency affects
> lots of people and introduces a new point of failure in the installation
> process, especially for Windows users who already have a devil of a time
> getting Twisted installed.

I never have much trouble, of course I always have a C compiler installed
and never use the Windows installer for Twisted any more.  The main issue I
have with installing Twisted, is that in order to use any of the command
like tools I have to go in and muck with the files (I think they just have
to be renamed...been a while since I've done it), since Twisted uses the
old distutils "script" method of installing them, rather than using
setuptools/sitribute or distutils2/packaging or whatever.

This means the various command line tools get installed (IIRC and if my
info is up to date) without file extensions, which is fine in a Unixy
environment, but don't work a'tall on Windows.

> Also I don't particularly like the testing style associated with Mock.  I
> think it might discourage us yet further from writing verified fakes, i.e.
> supported in-memory implementations of things like IReactorTCP, that have
> somewhat intricate behavior that's tedious to emulate with Mock.
My experience with mock is that when you need it it's really really
obvious, and if you don't, you shouldn't start using it, as it starts to
become a crutch.

> Personally I'm -0.  Don't let that stop you from cooking up a patch that
> would include it though, I might be in the minority here.
> -glyph
Kevin Horn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20121022/9b164247/attachment-0001.htm 

More information about the Twisted-Python mailing list