kiwicom / pytest-recording

A pytest plugin that allows recording network interactions via VCR.py
MIT License
425 stars 34 forks source link

More robust message for network access blocking #63

Open thatguysimon opened 3 years ago

thatguysimon commented 3 years ago

Hi! It would be great to see a more robust error message than "Network is disabled". This would be especially useful for newcomers or people who aren't aware that this package is installed on the project they are working on.

Some ideas for what it could contain:

  1. A title saying that the error is coming from this package
  2. A short summary of what happened. Why the error was raised.
  3. The http request that was made
  4. The list of configured allowed hosts (for quick comparison with the actual request made)
  5. Possible ways to solve the issue (change the request, record a cassette, add allowed hosts...)
  6. A link to the relevant section in the docs.

A great example of a similar error message is the message in Ruby's VCR implementation which you can see here: https://stackoverflow.com/questions/25799165/vcr-throwing-cant-handle-request-on-the-second-attempt-to-run-testfirst-attempt

Thanks!