[TIP] vcr

vanderson.mota at gmail.com vanderson.mota at gmail.com
Tue Mar 27 06:24:52 PDT 2012

VCR, as far as i know only works for HTTP. It is very easy to use, and
unfortunately i didn't find a match for it in python. It seems people are
more concerned about building "My new cool ruby-like test runner".

The coding strategy to make VCR was to monkeypatch the Http Libraries, like
the basic Net::Http, since there are a lot of http clients use it under the
hood. And for the ones who don't, the author wrote an adapter for the most
popular ones[1].

I think similar approach can be used with python.

1: https://github.com/myronmarston/vcr/tree/master/lib/vcr/library_hooks

2012/3/27 Andrea Crotti <andrea.crotti.0 at gmail.com>

> On 03/27/2012 12:55 PM, Benji York wrote:
>> On Tue, Mar 27, 2012 at 6:48 AM, Benji York<benji at benjiyork.com>  wrote:
>>> On Tue, Mar 27, 2012 at 5:31 AM, Andrea Crotti
>>> <andrea.crotti.0 at gmail.com>  wrote:
>>>> I just saw this library in action and I think it's great:
>>>> https://github.com/**myronmarston/vcr<https://github.com/myronmarston/vcr>
>>>> is there anything similar also in Python maybe??
>>> The Zope community used to use tcpwatch
>>> (http://pypi.python.org/pypi/**tcpwatch<http://pypi.python.org/pypi/tcpwatch>)
>>> in a similar way to record
>>> functional tests (http://wiki.zope.org/zope3/**fdoctests.html<http://wiki.zope.org/zope3/fdoctests.html>
>>> ).
>> Heh.  Now that I've read more carefully I can see that VCR does nothing
>> like I thought. :)
> What did you think it was doing?
> I think it's quite cool because it records the http transactions in yaml
> format, and
> they can be easily added to the repository to be played again during the
> next run of the test.
> I wonder if that only works with HTTP or is possible to generalise to any
> protocol.. (I don't see why not)
> ______________________________**_________________
> testing-in-python mailing list
> testing-in-python at lists.idyll.**org <testing-in-python at lists.idyll.org>
> http://lists.idyll.org/**listinfo/testing-in-python<http://lists.idyll.org/listinfo/testing-in-python>

Vanderson Mota dos Santos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20120327/967c24dc/attachment.htm>

More information about the testing-in-python mailing list