{"id":18657694,"url":"https://github.com/cle-b/pytest-httpdbg","last_synced_at":"2026-04-02T17:51:44.605Z","repository":{"id":163232456,"uuid":"637968930","full_name":"cle-b/pytest-httpdbg","owner":"cle-b","description":"A pytest plugin for recording HTTP(S) requests and saving them in your test report.","archived":false,"fork":false,"pushed_at":"2026-03-29T07:01:02.000Z","size":661,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-29T09:18:02.850Z","etag":null,"topics":["aiohttp","allure","allure-report","httpdbg","httpx","pytest","pytest-html","pytest-plugin","requests","urllib3"],"latest_commit_sha":null,"homepage":"https://httpdbg.readthedocs.io/en/latest/test/#pytest-httpdbg","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cle-b.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-05-08T19:54:44.000Z","updated_at":"2026-03-29T06:54:49.000Z","dependencies_parsed_at":"2025-04-11T18:39:13.754Z","dependency_job_id":"7752e764-e2c4-4d46-9242-33a5695035e9","html_url":"https://github.com/cle-b/pytest-httpdbg","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/cle-b/pytest-httpdbg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cle-b%2Fpytest-httpdbg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cle-b%2Fpytest-httpdbg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cle-b%2Fpytest-httpdbg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cle-b%2Fpytest-httpdbg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cle-b","download_url":"https://codeload.github.com/cle-b/pytest-httpdbg/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cle-b%2Fpytest-httpdbg/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31312744,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["aiohttp","allure","allure-report","httpdbg","httpx","pytest","pytest-html","pytest-plugin","requests","urllib3"],"created_at":"2024-11-07T07:29:36.044Z","updated_at":"2026-04-02T17:51:44.593Z","avatar_url":"https://github.com/cle-b.png","language":"Python","readme":"# pytest-httpdbg\n\nA pytest plugin for recording HTTP(S) requests and saving them in your test report.\n\n## installation \n\n```\npip install pytest-httpdbg\n```\n\n## Allure report\n\nIf you use the [allure-pytest](https://pypi.org/project/allure-pytest/) plugin to generate an [Allure](https://allurereport.org/docs/pytest/) report, you can use [pytest-httpdbg](https://pypi.org/project/pytest-httpdbg/) to include HTTP request traces in your test report without any code modifications.\n\nAll you need to do is add the `--httpdbg-allure` option to your pytest command line:\n\n```\npytest ../httpdbg-docs/examples/ --alluredir=./allure-results --httpdbg-allure\n``` \n\nIf an HTTP request is made by the test (or within a fixture, during the setup or teardown phase), a HTTP traces report will be saved in the Allure report under a step called `httpdbg`.\n\n### compact mode\n![](https://github.com/cle-b/pytest-httpdbg/blob/main/pytest-httpdbg-allure-compact-0.10.0.png?raw=true)\n\n### full mode\n![](https://github.com/cle-b/pytest-httpdbg/blob/main/pytest-httpdbg-allure-full-0.10.0.png?raw=true)\n\n\n## Custom test report\n\nYou can add HTTP traces to any test report of your choice. To do this, you can use the HTTP traces saved by the plugin in Markdown format.\n\nWhen a test finishes (including the teardown step), a log file in Markdown format is generated. The path to this log file is stored in the test item when the test starts (before the setup step), even if the file does not yet exist.\n\n### pytest-html\n\nYou can copy the following code in your top-level `conftest.py` to include the logs into your `pytest-html` report.\n\n```python\nimport os\n\nimport pytest\n\nfrom pytest_httpdbg import httpdbg_record_filename\n\n\n@pytest.hookimpl(hookwrapper=True)\ndef pytest_runtest_makereport(item, call):\n    pytest_html = item.config.pluginmanager.getplugin(\"html\")\n    outcome = yield\n    report = outcome.get_result()\n    extras = getattr(report, \"extras\", [])\n\n    if call.when == \"call\":\n        if httpdbg_record_filename in item.stash:\n            extras.append(\n                pytest_html.extras.url(\n                    os.path.basename(item.stash[httpdbg_record_filename]),\n                    name=\"HTTPDBG\",\n                )\n            )\n            report.extras = extras\n```\n\nThis example works if you use the same directory for the html test report file and the httpdbg logs. \n \n `pytest demo/ --httpdbg --httpdbg-dir report  --html=report/report.html`\n\nIf this is not the case, you must adapt it to your configuration.\n\n![](https://github.com/cle-b/pytest-httpdbg/blob/main/ui.png?raw=true)\n\n## pytest command line options\n\n```\nreporting:\n\n  --httpdbg                                 record HTTP(S) requests\n  --httpdbg-dir=HTTPDBG_DIR                 save httpdbg traces in a directory\n  --httpdbg-no-clean                        do not clean the httpdbg directory\n\n  --httpdbg-allure                          save HTTP(S) traces into the allure report\n  --httpdbg-only-on-failure                 save the HTTP requests only if the test failed\n\n  --httpdbg-initiator=HTTPDBG_INITIATOR     add a new initiator (package) for httpdbg\n\n```\n\n## httpdbg\n\nThis plugin is based on the [httpdbg](https://pypi.org/project/httpdbg/) Python tool. You can use it to trace all HTTP requests in your tests and view them in a more detailed user interface using the `pyhttpdbg` command.\n\n```\npyhttpdbg -m pytest -v examples/\n```\n\n![](https://github.com/cle-b/pytest-httpdbg/blob/main/httpdbg-pytest-1.2.1.png?raw=true)\n\n## documentation\n\nhttps://httpdbg.readthedocs.io/en/latest/test/#pytest-httpdbg\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcle-b%2Fpytest-httpdbg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcle-b%2Fpytest-httpdbg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcle-b%2Fpytest-httpdbg/lists"}