Registry / testing / pytest-reportportal

pytest-reportportal

JSON →
library5.6.11pypypi✓ verified 25d ago

pytest-reportportal is a Pytest plugin that serves as an agent for reporting test results to the ReportPortal test automation dashboard. It enables real-time reporting, detailed logs, and execution data analysis for Python tests run with Pytest. The library, currently at version 5.6.6, receives frequent minor updates to improve functionality, fix bugs, and maintain compatibility with Python and the ReportPortal client.

pip install pytest-reportportal
INSTALL
IMPORT
SIG · PYTEST-REPORTPORTA
P
pytest-reportportal
testingpythonv5.6.11
Install
4.7s avg
Import
898ms
Disk
31MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v5.6.11 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.950s · 30.8MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 4.7s · import 0.846s · 33MB
31MB installed
● package 31MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

RPLogger
✓ from reportportal_client import RPLogger
Used for integrating Python's standard logging module with ReportPortal to send logs during test execution.
RPLogHandler
✓ from reportportal_client import RPLogHandler
Used as a logging handler to direct Python logs to ReportPortal.

This quickstart demonstrates how to configure and run Pytest with `pytest-reportportal`. The core configuration involves setting `rp_endpoint`, `rp_project`, and `rp_api_key` (or OAuth credentials) either in a `pytest.ini` file or via environment variables. The `--reportportal` flag activates the plugin during test execution. A simple test file with passing, failing, and skipped tests is provided to show how results are reported.

import pytest import os # --- pytest.ini (simulated content for quickstart) --- # [pytest] # rp_endpoint = http://localhost:8080 # rp_project = default_personal # rp_api_key = your_api_key_from_reportportal_profile # rp_launch = MyPytestLaunch # To run this example: # 1. Ensure ReportPortal is running (e.g., via Docker). # 2. Set environment variables or create a pytest.ini file: # export RP_ENDPOINT="http://localhost:8080" # export RP_PROJECT="default_personal" # export RP_API_KEY="your_api_key" # 3. Save the test below as `test_example.py`. # 4. Run from your terminal: `pytest --reportportal test_example.py` def test_passing_example(): assert True def test_failing_example(): assert False @pytest.mark.skip(reason="demonstrating skip") def test_skipped_example(): pass
Debug
Known issues
breakingPython 3.8 support was removed starting from `pytest-reportportal` version 5.6.0. Users on Python 3.8 or older must upgrade their Python version to use recent agent versions.
fix
Upgrade Python to 3.9 or newer.
affects: >=5.6.0
deprecatedThe `rp_uuid` configuration parameter for authentication has been removed since version 5.5.3. It was replaced by `rp_api_key` for API Key authentication or a set of `rp_oauth_*` parameters for OAuth 2.0 Password Grant.
fix
Replace `rp_uuid` in your `pytest.ini` or environment variables with `rp_api_key` or the appropriate `rp_oauth_*` parameters. Your API key can be found in your ReportPortal user profile.
affects: >=5.5.3
breakingThe `retries` parameter for ReportPortal client configuration was removed in version 5.6.0. This parameter is no longer supported and will cause configuration errors if present.
fix
Remove the `retries` parameter from your `pytest.ini` or environment variables. The client now handles retries internally.
affects: >=5.6.0
gotchaUsing `pytest-xdist` with `pytest-reportportal` can lead to issues, especially with hierarchy reporting. While some fixes for `xdist` compatibility have been introduced (e.g., for code reference generation), complex scenarios might still exhibit unexpected behavior or limitations.
fix
Test your `pytest-xdist` setup thoroughly with `pytest-reportportal`. If you encounter issues, consider disabling hierarchy-related features (`rp_hierarchy_dirs`, `rp_hierarchy_code`) or running tests without `xdist` if full ReportPortal feature fidelity is critical.
affects: All versions
gotchaConfiguration parameters can be overridden by environment variables and command-line arguments. Environment variables (e.g., `RP_API_KEY`) take precedence over `pytest.ini` settings, and command-line arguments (e.g., `--rp-launch`) take precedence over both. This can lead to unexpected behavior if not managed carefully.
fix
Be explicit about your configuration hierarchy. For CI/CD, prefer environment variables or command-line arguments to override `pytest.ini` for sensitive data or dynamic launch parameters. Always check the effective configuration if reporting issues arise.
affects: All versions
Errors
Common errors & fixes
ERROR: Failed to connect to ReportPortal. Response code: 401
The ReportPortal API key (`rp_uuid`) or endpoint (`rp_endpoint`) configured is incorrect, expired, or the user lacks permissions to access the specified ReportPortal instance.
fix
Verify that `rp_uuid` and `rp_endpoint` in your `pytest.ini` file or environment variables are correct and match your ReportPortal instance and user profile. Ensure the user's UUID has the necessary permissions.
ModuleNotFoundError: No module named 'reportportal_client'
The `reportportal-client` library, a core dependency for `pytest-reportportal`, is not installed in your current Python environment.
fix
Install the required dependency using pip: `pip install reportportal-client`. If `pytest-reportportal` is also missing, install both: `pip install pytest-reportportal reportportal-client`.
reportportal_client.errors.ReportPortalError: Missing required parameter 'rp_project' in config.
The `rp_project` parameter (ReportPortal project name) is not defined in your `pytest.ini` file, environment variables, or as a command-line argument, which is mandatory for reporting test results.
fix
Add `rp_project = YOUR_PROJECT_NAME` to the `[pytest]` section of your `pytest.ini` file, or set the `RP_PROJECT` environment variable to your ReportPortal project name.
pytest: error: unrecognized arguments: --rp-invalid-option
You are attempting to use a command-line option for `pytest-reportportal` that is either misspelled, deprecated, or does not exist.
fix
Consult the `pytest-reportportal` documentation or `pytest --help` output for a list of valid command-line options (e.g., `--rp-endpoint`, `--rp-uuid`, `--rp-launch`) and correct your command.
Upgrade
Version history
5.6.11latest on PyPI · released Aug 19, 2026
Audit
Dependencies
reportportal-clientrequiredCore client library for interacting with the ReportPortal API. Frequently updated in parallel with the agent.
Agent activity
29 hits · last 30 days
node
26
OpenAI (training)
2
Resources