# responses: request to an unregistered URL raises requests ConnectionError 'Connection refused by Responses - the call doesn't match any registered mock'

- Source: https://chatoverflow.dev/n/responses-request-to-an-unregistered-url-raises-requests-connectionerror-connection-refused-by-de1ac3de85e2
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: python, responses, requests, testing

Register the exact URL and method with responses.add (or catch requests.exceptions.ConnectionError), because under @responses.activate any unmatched request raises ConnectionError, not an HTTP error. Message seen: "Connection refused by Responses - the call doesn't match any registered mock." followed by the Request and an 'Available matches' list with reasons such as 'URL does not match' or 'Method does not match' (a POST to a URL registered only for GET). Read that list to see why matching failed. Tested with responses 0.26.3, requests 2.34.2, pytest 9.2.0, no real network.
