Skip to main content

Important: this is draft version under development.

Pytest plugin for reporting test results of Pytest to the ‘Reportal Portal’.

Usage

Installation

To install pytest plugin execute next command in a terminal:

pip install pytest-reportportal

Configuration

Prepare the config file pytest.ini in root directory of tests or specify any one using pytest command line option:

py.test -c config.cfg

The pytest.ini file should have next mandatory fields:

  • rp_uuid - number could be found in the User profile section

  • rp_project - name of project in Report Potal

  • rp_endpoint - address of Report Portal Server

Example of pytest.ini:

[pytest]
rp_uuid = fb586627-32be-47dd-93c1-678873458a5f
rp_endpoint = http://192.168.1.10:8080
rp_project = user_personal
rp_launch_tags = 'PyTest' 'Smoke'

Also launch tags could be added, but this parapmeter is not mandatory rp_launch_tags = 'PyTest' 'Report_Portal'.

Logging

For logging of the test item flow to Report Portal, please, use the python logging handler privided by plugin like bellow:

# Import Report Portal handler in the test module.
from pytest_reportportal import RPlogHandler
# Get logger.
logger = logging.getLogger()
# Create hanler, set log level add it to the logger.
rp_handler = RPlogHandler()
rp_handler.setLevel(logging.INFO)
logger.addHandler(rp_handler)
# In this case only INFO messages will be sent to the Report Portal.
def test_one(self):
    logger.info("Case1. Step1")
    x = "this"
    logger.info("Case1. Step2")
    assert 'h' in x

Launching

To run test with Report Portal you need to specify neme of launch:

py.test ./tests --rp-launch AnyLaunchName

Release history Release notifications | RSS feed

5.6.11

2 files

5.6.10

2 files

5.6.9

2 files

5.6.8

2 files

5.6.7

2 files

5.6.6

2 files

5.6.5

2 files

5.6.4

2 files

5.6.3

2 files

5.6.2

2 files

5.6.1

2 files

5.6.0

2 files

5.5.4

2 files

5.5.3

2 files

5.5.2

2 files

5.5.1

2 files

5.5.0

2 files

5.4.7

2 files

5.4.6

2 files

5.4.5

2 files

5.4.4

2 files

5.4.3

2 files

5.4.2

2 files

5.4.1

2 files

5.4.0

2 files

5.3.2

2 files

5.3.1

2 files

5.3.0

2 files

5.2.2

2 files

5.2.1

2 files

5.2.0

2 files

5.1.9

2 files

5.1.8

2 files

5.1.7

2 files

5.1.6

2 files

5.1.5

2 files

5.1.4

2 files

5.1.3

2 files

5.1.2

2 files

5.1.1

2 files

5.1.0

2 files

5.0.12

2 files

5.0.11

2 files

5.0.10

2 files

5.0.9

2 files

5.0.8

2 files

5.0.7

2 files

5.0.6

2 files

5.0.5

2 files

5.0.4

2 files

5.0.3

2 files

5.0.2

2 files

5.0.1

2 files

5.0.0

2 files

1.10.1

2 files

1.10.0

2 files

1.0.9

2 files

1.0.8

2 files

1.0.7

1 file

1.0.5

2 files

1.0.4

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

This release

0.2.4 This release

0.2.3

1 file

0.2.2

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page