From 1114085dbb38be59ecb862f77e752772d7b55ca1 Mon Sep 17 00:00:00 2001 From: Jordan Cook Date: Mon, 18 Apr 2022 13:13:42 -0500 Subject: Turn VCR converter into an example in the docs instead of a library feature --- docs/examples.md | 14 ++++++++++++++ docs/user_guide/compatibility.md | 11 +++++++++++ 2 files changed, 25 insertions(+) (limited to 'docs') diff --git a/docs/examples.md b/docs/examples.md index 376e458..779a64d 100644 --- a/docs/examples.md +++ b/docs/examples.md @@ -166,3 +166,17 @@ The following scripts can also be found in the :lines: 6- ``` ::: + + +### VCR Export +```{include} ../examples/vcr.py +:start-line: 2 +:end-line: 5 +``` + +:::{admonition} Example: `vcr.py` +:class: toggle +```{literalinclude} ../examples/vcr.py +:lines: 7- +``` +::: \ No newline at end of file diff --git a/docs/user_guide/compatibility.md b/docs/user_guide/compatibility.md index 47eb5d4..fff338c 100644 --- a/docs/user_guide/compatibility.md +++ b/docs/user_guide/compatibility.md @@ -172,3 +172,14 @@ requests-mock examples above. ```{literalinclude} ../../tests/compat/test_responses_load_cache.py ``` ::: + +## VCR +If you would like to reuse your cached response data for unit tests, one option is to convert your +cache into a format compatible with VCR-vased libraries like +[vcrpy](https://github.com/kevin1024/vcrpy) and [betamax](https://github.com/betamaxpy/betamax). +:::{admonition} Example: vcr.py +:class: toggle +```{literalinclude} ../../examples/vcr.py +:lines: 7- +``` +::: -- cgit v1.2.1