responses

A utility for mocking out the Python Requests library. (by getsentry)

Responses Alternatives

Similar projects and alternatives to responses

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a better responses alternative or higher similarity.

Suggest an alternative to responses

responses reviews and mentions

Posts with mentions or reviews of responses. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2021-03-16.
  • Am new to Testing, Should I test Functions that Return a Queryset?
    1 project | reddit.com/r/django | 11 May 2021
    The repsonses library is designed for mocking requests during tests https://github.com/getsentry/responses
  • Testing for API data (python)
    1 project | reddit.com/r/dataengineering | 10 May 2021
    I like using responses for mocking API calls in unit tests. It's easy to use and has less boilerplate than doing the mocks yourself. The bulk of your unit tests should be around any data transformation you do, and unit testing them should be fairly straightforward. I'd recommend writing integration tests as well, especially as IME the most common reason why data pipelines with API sources break is due to breaking API changes out of your control. I'd make them as high level as possible and make real API calls, preferably using credentials for a designated testing account. Assert the response from the API call conforms to the contract you expect. Additionally to integration test your code, you can test the main entrypoint to your script and make sure it spits out a file with the shape and contents you expect.
  • Two Methods for Testing HTTPS API Calls with Python and pytest and also Communicating with the In-laws
    4 projects | dev.to | 16 Mar 2021
    HTTP client library flexibility. Yes, requests pairs well with responses or requests-mock, and HTTPX has RESPX or pytest_httpx. Those testing helpers are an excellent match for the corresponding library, and should certainly be recommended. However, I don't always want to face the risk of rewriting all my tests if I replace the client library some day. And sometimes I am using an altogether different tool (even though both requests and HTTPX are quite awesome) such as urlopen, urllib3, httplib2, tornado, or aiohttp.
  • A few tools for using HTTPS in tests
    3 projects | reddit.com/r/Python | 13 Mar 2021
    I also know there is vcr, and requests pairs well with responses or requests-mock, and HTTPX has RESPX or pytest_httpx.
  • Flask & Pytest
    1 project | reddit.com/r/flask | 27 Feb 2021
    I almost always end up using requests in my flask app soon or later, I recommend using responses https://github.com/getsentry/responses in one of your pytest fixtures and set autouse to true so if you ever accidentally call requests it will fail unless you specifically test for it.

Stats

Basic responses repo stats
5
3,571
9.1
19 days ago

getsentry/responses is an open source project licensed under Apache License 2.0 which is an OSI approved license.

SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
Find remote Python jobs at our new job board 99remotejobs.com. There is 1 new remote job listed recently.
Are you hiring? Post a new remote job listing for free.