Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No cassettes found on vcrpy==5.0.0 release. Works with 4.* #111

Closed
Alexander-Serov opened this issue Jun 27, 2023 · 10 comments · Fixed by #118
Closed

No cassettes found on vcrpy==5.0.0 release. Works with 4.* #111

Alexander-Serov opened this issue Jun 27, 2023 · 10 comments · Fixed by #118

Comments

@Alexander-Serov
Copy link

Describe the bug
vcrpy==5.0 has been released and pytest-recording does not work with it anymore. A vcrpy maintainer has indicated that this is related to that VCR.py 5.0.0 is no longer expecting and catching ValueError but a new exception CassetteNotFoundError. And pytest-recording seems to not limit the version of vcr.py to the current major version, so it broke on upstream upgrade.

To Reproduce
Launch any test with vcrpy==5.0 on cassettes created with vcrpy==4.*. See here for an example of the output. The main message is

>           raise ValueError("No cassettes found.")
E           ValueError: No cassettes found.
venv/lib/python3.8/site-packages/pytest_recording/_vcr.py:48: ValueError

Expected behavior

  • correctly interact with vcrpy==5.0
  • intercept the new exception
  • suggestion: in future, limit compatibility to a major upstream version only vcrpy~=5.0 and perform major updates manually.

Environment (please complete the following information):

does not seem to be pertinent, but

  • OS: Darwin
  • Python version: 3.8.10
  • pytest-recording version: 0.12.1
  • pytest version: 7.2.0

Additional context
Cc @hartwork

@Stranger6667
Copy link
Collaborator

Hi!

Thanks for opening an issue! A WIP PR is here

@hartwork
Copy link
Contributor

hartwork commented Jun 27, 2023

@Alexander-Serov thanks for the report!

Expected behavior

  • correctly interact with vcrpy==5.0

  • intercept the new exception

I think you meant raising CassetteDecodeError or CassetteNotFoundErrorinstead.

  • suggestion: in future, limit compatibility to a major upstream version only vcrpy~=5.0 and perform major updates manually.

I would like to vote for just vcrpy>=5.0 (or no limit) and leave the rest to the and user / consuming application. Bumping VCR.py from 4.x.x to 5.0.0 is a major version bump in semver so the user has full responsibility in my view.

@Alexander-Serov
Copy link
Author

@hartwork agreed on bumping to a major version, and pytest-recording is the user in this case. But to avoid accidents like this one, when the pipeline becomes blocked, I would vote for setting vcrpy>=5.0,<6 in this repo, with the update to 6 done manually. This would give time to the maintainers of this repo to implement changes and test without people like me coming and opening issues. And the end user does not specify a version of vcrpy since it's an internal dep of pytest-recording for us. Just my 2 cents.

@Stranger6667 Thanks for already working on it!

@Stranger6667
Copy link
Collaborator

I guess the props for working on the issue should go to @gadomski :)

At this point, instead of failing in runtime, it would be better to note that pytest-recording is compatible only with vcrpy<4.4.0 (there is 1 failing test)

@mezhaka
Copy link

mezhaka commented Jul 26, 2023

Hi folks, I see the PR #110 has been suspended for now. Is there any plan or intention in this direction?

@Stranger6667
Copy link
Collaborator

hi @mezhaka !

Yes, I'd like to add support for vcrpy==5.0.0, but I don't have the bandwidth at the moment. Meantime, PRs (including those adding partial support) are welcome

@hartwork
Copy link
Contributor

@Stranger6667 thanks for partial, I'll give it another shot right now…

@hartwork
Copy link
Contributor

Pull request #118 now ready for a first round of review.

@Stranger6667
Copy link
Collaborator

Thank you @hartwork !

I'll release a new version this week! :) Hopefully, I could also take a look at the tests that are failing on VCRPy 5.0

@Stranger6667
Copy link
Collaborator

The new version is released! 🎉 Thank you for your patience

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants