{"library":"pytest-json-report","title":"pytest-json-report","description":"pytest-json-report is a pytest plugin that generates a comprehensive JSON report of your test results. It provides detailed information on test outcomes, collected items, and environment details, useful for integration with CI/CD systems or custom reporting tools. The current version is 1.5.0, with minor releases occurring every few months to address bugs and add features.","language":"python","status":"active","last_verified":"Thu Apr 09","install":{"commands":["pip install pytest-json-report"],"cli":null},"imports":[],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import pytest\nimport json\nimport os\n\ndef test_success():\n    assert True\n\ndef test_failure():\n    assert False\n\n@pytest.mark.skip(reason=\"demonstrating skip\")\ndef test_skipped():\n    pass\n\ndef test_record_property(record_property):\n    record_property(\"my_custom_key\", \"my_custom_value\")\n    assert True\n\n# Run pytest and generate report.json\n# os.system('pytest --json-report') would run it, but for a quickstart example, we'll demonstrate the command.\nprint(\"To run this example, save it as `test_example.py` and run:\")\nprint(\"pytest --json-report\")\nprint(\"Then inspect the generated `report.json` file.\")\n\n# Example of reading the report (would typically be in a separate script or CI/CD)\n# if os.path.exists('report.json'):\n#     with open('report.json', 'r') as f:\n#         report_data = json.load(f)\n#     print(json.dumps(report_data['summary'], indent=2))\n","lang":"python","description":"Create a `test_example.py` file with some tests, then run `pytest --json-report` from your terminal. This command will execute your tests and generate a `report.json` file in your current working directory containing the test results and a summary.","tag":null,"tag_description":null,"last_tested":"2026-04-24","results":[{"runtime":"python:3.10-alpine","exit_code":0},{"runtime":"python:3.10-slim","exit_code":0},{"runtime":"python:3.11-alpine","exit_code":0},{"runtime":"python:3.11-slim","exit_code":0},{"runtime":"python:3.12-alpine","exit_code":0},{"runtime":"python:3.12-slim","exit_code":0},{"runtime":"python:3.13-alpine","exit_code":0},{"runtime":"python:3.13-slim","exit_code":0},{"runtime":"python:3.9-alpine","exit_code":0},{"runtime":"python:3.9-slim","exit_code":0}]},"compatibility":null}