kiwicom/pytest-recording

What is the relationship to pytest-vcr?

MartinThoma opened this issue · 2 comments

I have seen pytest-recording (on pypi) which looks pretty similar:

  • Uses @pytest.mark.vcr
  • Both seem to be wrappers around vcr.py
  • 49 stars, 3 forks, 2 contributors vs 67 stars, 17 forks, 7 contributors
  • First tag in 2019 vs first tag in 2017

My guess is that pytest-recording is a fork of pytest-vcr. But why was the fork done and what is the relationship to pytest-vcr? When should one use one or the other?

Hello @MartinThoma

Thank you for asking! It is not a fork, but implementation from scratch. I had a slightly different vision of plugin's API and features. We used pytest-vcr before and submitted a PR to adjust the API. However, it wasn't addressed by the pytest-vcr author and some other PRs were not addressed either - to me, the library looked abandoned.
There is more info about the differences between these two plugins, but there are some new changes that were not yet done when I wrote that comment in the link above:

  • pytest-recording is not affected by this bug reported to pytest-vcr
  • it provides pytest_recording_configure hook for better customization
  • rewrite record mode, that was actually requested in VCRpy itself
  • Pytest assertions rewriting for better error output (wasn't addressed in pytest-vcr)

When should one use one or the other?

I'd say that there are more features in pytest-recording, than in pytest-vcr and one of my explicit goals was to have a drop-in replacement for pytest-vcr, but I am biased and might miss something in pytest-vcr. However, I'd be happy to know if anything is missing and implement it here :)

Let me know if I can provide more info to you

Thank you very much! This helps a lot :-)