{"id":13501313,"url":"https://github.com/lundberg/respx","last_synced_at":"2026-02-22T14:44:33.866Z","repository":{"id":38864055,"uuid":"221497383","full_name":"lundberg/respx","owner":"lundberg","description":"Mock HTTPX with awesome request patterns and response side effects 🦋","archived":false,"fork":false,"pushed_at":"2025-02-27T04:50:38.000Z","size":1563,"stargazers_count":661,"open_issues_count":21,"forks_count":44,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-23T07:33:45.919Z","etag":null,"topics":["httpx","mock","pytest","testing"],"latest_commit_sha":null,"homepage":"https://lundberg.github.io/respx","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lundberg.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-13T15:57:09.000Z","updated_at":"2025-03-20T18:39:43.000Z","dependencies_parsed_at":"2024-03-18T17:28:28.360Z","dependency_job_id":"beba26d1-c07a-4b57-973a-7d39bb199e29","html_url":"https://github.com/lundberg/respx","commit_stats":{"total_commits":353,"total_committers":20,"mean_commits":17.65,"dds":0.09915014164305946,"last_synced_commit":"42930fc9d401c24476e159e9bed4181ea459cbc4"},"previous_names":[],"tags_count":47,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lundberg%2Frespx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lundberg%2Frespx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lundberg%2Frespx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lundberg%2Frespx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lundberg","download_url":"https://codeload.github.com/lundberg/respx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246162092,"owners_count":20733351,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["httpx","mock","pytest","testing"],"created_at":"2024-07-31T22:01:32.807Z","updated_at":"2025-10-21T19:33:57.734Z","avatar_url":"https://github.com/lundberg.png","language":"Python","readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://lundberg.github.io/respx/\"\u003e\u003cimg width=\"350\" height=\"208\" src=\"https://raw.githubusercontent.com/lundberg/respx/master/docs/img/respx.png\" alt='RESPX'\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eRESPX\u003c/strong\u003e \u003cem\u003e- Mock HTTPX with awesome request patterns and response side effects.\u003c/em\u003e\n\u003c/p\u003e\n\n---\n\n[![tests](https://img.shields.io/github/actions/workflow/status/lundberg/respx/test.yml?branch=master\u0026label=tests\u0026logo=github\u0026logoColor=white\u0026style=for-the-badge)](https://github.com/lundberg/respx/actions/workflows/test.yml)\n[![codecov](https://img.shields.io/codecov/c/github/lundberg/respx?logo=codecov\u0026logoColor=white\u0026style=for-the-badge)](https://codecov.io/gh/lundberg/respx)\n[![PyPi Version](https://img.shields.io/pypi/v/respx?logo=pypi\u0026logoColor=white\u0026style=for-the-badge)](https://pypi.org/project/respx/)\n[![Python Versions](https://img.shields.io/pypi/pyversions/respx?logo=python\u0026logoColor=white\u0026style=for-the-badge)](https://pypi.org/project/respx/)\n\n## Documentation\n\nFull documentation is available at\n[lundberg.github.io/respx](https://lundberg.github.io/respx/)\n\n## QuickStart\n\nRESPX is a simple, _yet powerful_, utility for mocking out the\n[HTTPX](https://www.python-httpx.org/), _and\n[HTTP Core](https://www.encode.io/httpcore/)_, libraries.\n\nStart by [patching](https://lundberg.github.io/respx/guide/#mock-httpx) `HTTPX`, using\n`respx.mock`, then add request\n[routes](https://lundberg.github.io/respx/guide/#routing-requests) to mock\n[responses](https://lundberg.github.io/respx/guide/#mocking-responses).\n\n```python\nimport httpx\nimport respx\n\nfrom httpx import Response\n\n\n@respx.mock\ndef test_example():\n    my_route = respx.get(\"https://example.org/\").mock(return_value=Response(204))\n    response = httpx.get(\"https://example.org/\")\n    assert my_route.called\n    assert response.status_code == 204\n```\n\n\u003e Read the [User Guide](https://lundberg.github.io/respx/guide/) for a complete\n\u003e walk-through.\n\n### pytest + httpx\n\nFor a neater `pytest` experience, RESPX includes a `respx_mock` _fixture_ for easy\n`HTTPX` mocking, along with an optional `respx` _marker_ to fine-tune the mock\n[settings](https://lundberg.github.io/respx/api/#configuration).\n\n```python\nimport httpx\nimport pytest\n\n\ndef test_default(respx_mock):\n    respx_mock.get(\"https://foo.bar/\").mock(return_value=httpx.Response(204))\n    response = httpx.get(\"https://foo.bar/\")\n    assert response.status_code == 204\n\n\n@pytest.mark.respx(base_url=\"https://foo.bar\")\ndef test_with_marker(respx_mock):\n    respx_mock.get(\"/baz/\").mock(return_value=httpx.Response(204))\n    response = httpx.get(\"https://foo.bar/baz/\")\n    assert response.status_code == 204\n```\n\n## Installation\n\nInstall with pip:\n\n```console\n$ pip install respx\n```\n\nRequires Python 3.8+ and HTTPX 0.25+. See\n[Changelog](https://github.com/lundberg/respx/blob/master/CHANGELOG.md) for older HTTPX\ncompatibility.\n","funding_links":[],"categories":["Python","testing"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flundberg%2Frespx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flundberg%2Frespx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flundberg%2Frespx/lists"}