[TIP] Library supporting fixture composition: kt.testing

Fred Drake fred at fdrake.net
Tue Mar 22 14:38:47 PDT 2016


On Tue, Mar 22, 2016 at 2:09 PM, Ian Cordasco
<graffatcolmingov at gmail.com> wrote:
> How does this compare to https://github.com/testing-cabal/fixtures,
> https://github.com/openstack/requests-mock, and
> https://github.com/sigmavirus24/betamax?
>
> It seems like it is reinventing (perhaps without the benefit of
> experience) the fixtures library and parts of other libraries might
> not really be helpful.

Hmm; it might not be so interesting.  I wasn't aware of the libraries
you identified, and will take a look at them.

There are two distinct aspects to kt.testing:

1. a model for fixture composition, which I was interested in since
many of the fixtures I use want to provide APIs of their own, and

2. the specific fixture for requests.  This is included both as an
example and because we needed something like this for the project I'm
working on these days.

The requests fixture is fairly simple; something better might include
support for other web-requesting front-end APIs (urllib, urllib2,
etc.), since for most tests the point is to make sure the request is
mocked appropriately, without concern for which API the application
actually uses to make the request. Maybe there's already a package
that does that.


  -Fred

-- 
Fred L. Drake, Jr.    <fred at fdrake.net>
"A storm broke loose in my mind."  --Albert Einstein



More information about the testing-in-python mailing list