{"categories":[{"label":"Testing","url":"https://skillfed.io/packages/category/software-development-testing/5"}],"enrichment":{"capability":"Mocks external HTTP/HTTPS services for asyncio-based tests by intercepting aiohttp requests and returning predefined responses without making real network calls.","skillfed_tags":["async-testing","http-mocking"],"use_cases":["Unit test an async client library or service that calls external APIs without making real HTTP requests.","Simulate error responses (500, timeouts, malformed JSON) to test error handling in async code.","Mock multiple external services in a single test by registering different routes for different hosts.","Verify that your async code calls external APIs in the correct order with the correct parameters.","Test HTTPS requests by transparently converting them to HTTP mocks without certificate setup."],"what_it_does":"aresponses is a test fixture and mock server for asyncio applications that use aiohttp. It intercepts HTTP and HTTPS requests made by aiohttp.ClientSession and returns predefined responses without touching the network. You define routes using pattern matching (exact strings or regular expressions) on host, path, method, and body, then attach responses\u2014plain text, JSON dicts, custom Response objects, or callable handlers. When your test code makes a request, aresponses matches it to the first registered route, returns the response, and removes that route from the table.\n\nThe package is designed for pytest integration and requires explicit assertions at the end of each test to verify that routes were called in order, all routes were used, and no unmatched requests occurred. It supports regex patterns for flexible matching, repeated routes via the repeat parameter, JSON responses as a convenience, custom handler functions, and a passthrough mode to let specific requests reach the real network. Version 3.0.0 updated to use asyncio.get_running_loop() instead of the deprecated event_loop fixture pattern.","worth_installing":"Yes, if you write asyncio tests with aiohttp. It has low install friction, no known vulnerabilities, permissive licensing, and is stable and widely used despite dormant maintenance. The trade-off: the last release was over 945 days ago, so if you need fixes for new Python or aiohttp versions, you may need to fork or wait for a maintainer response. For active projects on current Python (3.7\u20133.12), it works as-is."},"id":"aresponses","links":{"html":"https://skillfed.io/packages/aresponses","md":"https://skillfed.io/packages/aresponses.md","pypi":"https://pypi.org/project/aresponses/"},"maintenance":{"status":"dormant"},"meta":{"latest_release":"2024-01-12","license_spdx":null,"license_treatment":"permissive","name":"aresponses","python_support":"supports_current","summary":"Asyncio response mocking. Similar to the responses library used for 'requests'"},"popularity":{"monthly_downloads":115539,"position":12245,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"3.0.0"}
