From 72129cc386731ddfbf7b31dd9c7e338240655830 Mon Sep 17 00:00:00 2001 From: Fahad Khan Date: Mon, 23 Feb 2026 14:49:13 -0800 Subject: [PATCH] added --rp-launch-attributes and --rp-tests-attributes CLI args --- pytest_reportportal/plugin.py | 14 ++++++++++++-- tests/unit/test_plugin.py | 2 ++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/pytest_reportportal/plugin.py b/pytest_reportportal/plugin.py index 8d8465b..8059650 100644 --- a/pytest_reportportal/plugin.py +++ b/pytest_reportportal/plugin.py @@ -590,8 +590,18 @@ def add_shared_option(name, help_str, default=None, action="store"): parser.addini("rp_oauth_client_secret", type="args", help="OAuth 2.0 client secret") parser.addini("rp_oauth_scope", type="args", help="OAuth 2.0 access token scope") - parser.addini("rp_launch_attributes", type="args", help="Launch attributes, i.e Performance Regression") - parser.addini("rp_tests_attributes", type="args", help="Attributes for all tests items, e.g. Smoke") + rp_launch_attributes_help_str = "Launch attributes, i.e Performance Regression." + parser.addini("rp_launch_attributes", type="args", help=rp_launch_attributes_help_str) + group.addoption( + "--rp-launch-attributes", dest="rp_launch_attributes", help=rp_launch_attributes_help_str, nargs="+" + ) + + rp_test_attributes_help_str = "Attributes for all tests items, e.g. Smoke." + parser.addini("rp_tests_attributes", type="args", help=rp_test_attributes_help_str) + group.addoption( + "--rp-tests-attributes", dest="rp_tests_attributes", help=rp_test_attributes_help_str, nargs="+" + ) + parser.addini("rp_log_batch_size", default="20", help="Size of batch log requests in async mode") parser.addini( "rp_log_batch_payload_limit", diff --git a/tests/unit/test_plugin.py b/tests/unit/test_plugin.py index 9912f73..d3a8f4c 100644 --- a/tests/unit/test_plugin.py +++ b/tests/unit/test_plugin.py @@ -308,6 +308,8 @@ def test_pytest_addoption_adds_correct_command_line_arguments(): "--rp-thread-logging", "--rp-launch-uuid-print", "--rp-launch-uuid-print-output", + '--rp-launch-attributes', + '--rp-tests-attributes' ) mock_parser = mock.MagicMock(spec=Parser) mock_reporting_group = mock_parser.getgroup.return_value