vcrpy icon indicating copy to clipboard operation
vcrpy copied to clipboard

persisters/filesystem_cached: Add file-based persister with cache

Open gioele opened this issue 4 years ago • 1 comments
trafficstars

This persister keeps a cache of cassettes, to avoid the overhead of constantly serializing and deserializing unchanged cassettes.

This is especially useful when no changes to the cassette are expected, for example when running testsuites with mode=none.

In a testsuite with hundreds of calls backed from YAML cassettes with 10k responses, the use of this persister saves various minutes.

gioele avatar Feb 14 '21 19:02 gioele

Codecov Report

Merging #576 (d6ed6e0) into master (6e04003) will increase coverage by 1.05%. The diff coverage is 78.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #576      +/-   ##
==========================================
+ Coverage   89.01%   90.06%   +1.05%     
==========================================
  Files          24       27       +3     
  Lines        1539     1742     +203     
  Branches      212      243      +31     
==========================================
+ Hits         1370     1569     +199     
+ Misses        139      135       -4     
- Partials       30       38       +8     
Impacted Files Coverage Δ
vcr/persisters/filesystem_cached.py 0.00% <0.00%> (ø)
vcr/stubs/aiohttp_stubs.py 94.30% <88.05%> (ø)
vcr/stubs/httpx_stubs.py 97.80% <97.80%> (ø)
vcr/cassette.py 97.15% <100.00%> (+0.98%) :arrow_up:
vcr/config.py 95.00% <100.00%> (+0.03%) :arrow_up:
vcr/patch.py 89.41% <100.00%> (+5.04%) :arrow_up:
vcr/record_mode.py 100.00% <100.00%> (ø)
vcr/serializers/jsonserializer.py 100.00% <100.00%> (ø)
vcr/serializers/yamlserializer.py 77.77% <0.00%> (-22.23%) :arrow_down:
vcr/migration.py 74.48% <0.00%> (-2.05%) :arrow_down:
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update c79a06f...d6ed6e0. Read the comment docs.

codecov-io avatar Feb 14 '21 20:02 codecov-io