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

More informative exceptions when recording not found #5

Open
artdgn opened this issue Mar 4, 2019 · 0 comments
Open

More informative exceptions when recording not found #5

artdgn opened this issue Mar 4, 2019 · 0 comments

Comments

@artdgn
Copy link

artdgn commented Mar 4, 2019

I recently had to make a change to a repo that's using recording in it's tests, and at first couldn't figure out why I'm getting connection-refused errors coming from responses package. It took me a while to understand that there is global patching to requests and that connection-refused errors are in fact recording-not-found errors.

Perhaps it's worth to make sure that the exception raised during various failures are making it clear that mocking is taking place and that it's failing.

Perhaps it also could be helpful to suggest a way to disable mocking in the exception.

class RecordingNotFound(Exception):
    pass

# and than
raise RecordingNotFound("Pytest VTS request-response recording not found. "
                        "If you're trying to make live connections disable "
                        "mocking by setting environment variable "
                        "PYTEST_VTS_FORCE_RECORDING to true")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant