{"library":"pytest-reportlog","title":"pytest-reportlog","description":"pytest-reportlog is a pytest plugin that provides a modern, extensible replacement for the deprecated `--resultlog` option. It focuses on simplicity and extensibility by writing a stream of machine-readable JSON line objects (JSONL) representing test session events to a specified file. Each line contains a self-contained JSON object corresponding to a testing event, ensuring real-time processing capabilities as the file is guaranteed to be flushed after each line. The current version is 1.0.0, and it is maintained by the pytest-dev team, with releases typically tied to major pytest version compatibility or feature enhancements.","language":"python","status":"active","last_verified":"Fri May 15","install":{"commands":["pip install pytest-reportlog"],"cli":null},"imports":["This is a pytest plugin, used via command-line options; no direct Python imports are typically needed by users."],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"# 1. Create a test file (e.g., test_example.py):\n# ---\n# # content of test_example.py\n# def test_ok():\n#     assert 5 + 5 == 10\n#\n# def test_fail():\n#     assert 4 + 4 == 1\n# ---\n\n# 2. Run pytest with the --report-log option:\n# pytest test_example.py --report-log=log.jsonl\n\n# 3. Inspect the generated log file (e.g., with Python):\nimport json\nimport os\n\nlog_file_path = \"log.jsonl\"\n\n# This part simulates running pytest and creating the file.\n# In a real scenario, you'd run the `pytest` command above in your shell.\n# For quickstart execution, we create a dummy file if it doesn't exist.\nif not os.path.exists(log_file_path):\n    with open(log_file_path, \"w\") as f:\n        f.write('{\"pytest_version\": \"8.0.0\", \"$report_type\": \"SessionStart\"}\\n')\n        f.write('{\"nodeid\": \"test_example.py::test_ok\", \"duration\": 0.0001, \"outcome\": \"passed\", \"$report_type\": \"TestReport\"}\\n')\n        f.write('{\"nodeid\": \"test_example.py::test_fail\", \"duration\": 0.0002, \"outcome\": \"failed\", \"$report_type\": \"TestReport\"}\\n')\n        f.write('{\"exitstatus\": 1, \"$report_type\": \"SessionFinish\"}\\n')\n\nprint(f\"Reading first few lines from {log_file_path}:\")\nwith open(log_file_path, \"r\") as f:\n    for i, line in enumerate(f):\n        if i >= 3: # Print first 3 events for brevity\n            break\n        print(json.loads(line))\n\n# Clean up the dummy file\nos.remove(log_file_path)\n","lang":"python","description":"To get started, you simply install the plugin and use the `--report-log=FILE` command-line option when running `pytest`. This will generate a JSONL file containing one JSON object per line, representing various test events.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-15","installed_version":"0.4.0","pypi_latest":"1.0.0","is_stale":true,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":2.7,"avg_import_s":null,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"pytest-reportlog","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"30.7M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"pytest-reportlog","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":2.6,"import_time_s":null,"mem_mb":null,"disk_size":"31M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"pytest-reportlog","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"33.6M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"pytest-reportlog","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":2.6,"import_time_s":null,"mem_mb":null,"disk_size":"34M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"pytest-reportlog","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"25.2M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"pytest-reportlog","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":2.5,"import_time_s":null,"mem_mb":null,"disk_size":"26M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"pytest-reportlog","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"25.0M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"pytest-reportlog","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":2.5,"import_time_s":null,"mem_mb":null,"disk_size":"25M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"pytest-reportlog","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"30.0M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"pytest-reportlog","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":3.1,"import_time_s":null,"mem_mb":null,"disk_size":"31M"}]}}