[TIP] vcr
Benji York
benji at benjiyork.com
Tue Mar 27 03:48:25 PDT 2012
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
>
> is there anything similar also in Python maybe??
The Zope community used to use tcpwatch
(http://pypi.python.org/pypi/tcpwatch) in a similar way to record
functional tests (http://wiki.zope.org/zope3/fdoctests.html).
The approach was used for a few years, but was ultimately abandoned. My
recollection is that there were two main issues with the approach: 1)
Teasing out enough intent from a HTTP stream to generate a reasonable
first cut at a test is difficult which required extensive post-recording
editing by a human. 2) Re-recording a test in whole is time consuming,
and re-recording just a part is hard to do (normally lots of
pre-existing state is assumed).
There was a follow-on attempt at in-browser recording of tests that
helped with problem #1 quite a bit; recording clicks and keystrokes
instead of just HTTP requests gets you closer to intent. It didn't do
too much for #2 though. The project hasn't been maintained in a few
years: http://pypi.python.org/pypi/zope.testrecorder
I haven't looked hard at the link you provided. Maybe they have found
ways around those issues.
--
Benji York
More information about the testing-in-python
mailing list