--- id: urllib3-mock version: "0.3.3" license: Apache 2.0 license_treatment: permissive maintenance: abandoned --- # urllib3-mock — A utility library for mocking out the `urllib3` Python library. License: permissive · Maintenance: abandoned · Downloads: 150.5K/mo ## What it is and what it does urllib3-mock is a test utility that intercepts urllib3 HTTP calls and returns mock responses instead of making real network requests. It was adapted from the responses library and allows you to register predefined responses for specific URLs, or attach callbacks that generate responses dynamically based on request content. You can match URLs by exact string or compiled regex, set custom status codes and headers, or throw exceptions to simulate network failures. The package is designed to work with urllib3 as bundled inside requests (requests.packages.urllib3). It has been abandoned since 2015; the latest release was 0.3.3 on 2015-04-16, and the repository has not been updated since 2023-01-17. It is only suitable for projects locked to very old versions of its target library. Use it for: - Unit test code that makes HTTP calls without making actual network requests. - Mock specific API endpoints with fixed responses to test error handling and edge cases. - Use request callbacks to simulate dynamic server behavior based on request body. - Test code paths that depend on specific HTTP status codes or response headers. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Mocks urllib3 HTTP requests in tests by intercepting calls and returning predefined responses or callback-generated replies. No. The package is abandoned (last release 2015-04-16, no commits since 2023-01-17) and designed for outdated bundled urllib3 in old requests versions. Modern projects should use alternative mocking libraries. Install only if you are maintaining legacy code locked to very old dependencies and cannot migrate. ## Install pip install urllib3-mock uv add urllib3-mock poetry add urllib3-mock ## Installing urllib3-mock Before you install: Low friction to install, but maintenance is abandoned—last release was 2015-04-16 and no commits since 2023-01-17. Use only if your project is locked to old urllib3 versions. License in practice: Apache 2.0 is permissive; you may use, modify, and distribute this package freely in commercial and private projects with minimal restrictions. Quickstart: from urllib3_mock import Responses responses = Responses('requests.packages.urllib3') @responses.activate def test_api(): responses.add('GET', '/api/foobar', body='{"ok": true}', status=200) assert len(responses.calls) == 0 Designed for requests.packages.urllib3 (bundled urllib3 in older requests versions); compatibility with current versions unknown. Verify before relying: - Compatibility with current urllib3 and requests versions—package is abandoned and last tested in 2015. - Whether regex URL matching and exception-throwing features work reliably in modern Python environments. - Whether this package works with standalone urllib3 or only with bundled urllib3 in requests. ## Package facts - License: Apache 2.0 (permissive) - Python support: unspecified - Install friction: low - Maintenance: abandoned - Downloads: 150.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags mock urllib3 requests, urllib3 test mocking, http request mocking, fake urllib3 responses, test http calls, urllib3 testing utility, http-mocking, legacy-package [View on SkillFed](https://skillfed.io/packages/urllib3-mock) · [View on PyPI](https://pypi.org/project/urllib3-mock/)