Skip to content

Commit 33d711f

Browse files
authored
Merge pull request #373 from reportportal/develop
Release
2 parents d537e44 + 097391f commit 33d711f

File tree

7 files changed

+25
-15
lines changed

7 files changed

+25
-15
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
runs-on: ubuntu-latest
2121
strategy:
2222
matrix:
23-
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11' ]
23+
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11', '3.12' ]
2424
steps:
2525
- name: Checkout repository
2626
uses: actions/checkout@v4

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
## [Unreleased]
44
### Fixed
5+
- Issue [#368](https://github.com/reportportal/agent-python-pytest/issues/368): Distutils in the agent, by @HardNorth
6+
- Pytest Tavern plugin support, by @virdok
7+
### Added
8+
- Python 12 support, by @HardNorth
9+
10+
## [5.4.1]
11+
### Fixed
512
- Issue [#362](https://github.com/reportportal/agent-python-pytest/issues/362): Debug mode passing, by @HardNorth
613

714
## [5.4.0]

pytest_reportportal/config.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
"""This module contains class that stores RP agent configuration data."""
1515

1616
import warnings
17-
from distutils.util import strtobool
1817
from os import getenv
1918
from typing import Optional, Union, Any, Tuple
2019

2120
from _pytest.config import Config
2221
from reportportal_client import OutputType, ClientType
2322
from reportportal_client.logs import MAX_LOG_BATCH_PAYLOAD_SIZE
23+
from reportportal_client.helpers import to_bool
2424

2525
try:
2626
# This try/except can go away once we support pytest >= 5.4.0
@@ -116,9 +116,7 @@ def __init__(self, pytest_config: Config) -> None:
116116
self.rp_log_batch_payload_size = MAX_LOG_BATCH_PAYLOAD_SIZE
117117
self.rp_log_level = get_actual_log_level(pytest_config, 'rp_log_level')
118118
self.rp_log_format = self.find_option(pytest_config, 'rp_log_format')
119-
self.rp_thread_logging = bool(strtobool(str(self.find_option(
120-
pytest_config, 'rp_thread_logging'
121-
) or False)))
119+
self.rp_thread_logging = to_bool(self.find_option(pytest_config, 'rp_thread_logging') or False)
122120
self.rp_mode = self.find_option(pytest_config, 'rp_mode')
123121
self.rp_parent_item_id = self.find_option(pytest_config,
124122
'rp_parent_item_id')
@@ -177,15 +175,13 @@ def __init__(self, pytest_config: Config) -> None:
177175

178176
rp_verify_ssl = self.find_option(pytest_config, 'rp_verify_ssl', True)
179177
try:
180-
self.rp_verify_ssl = bool(strtobool(rp_verify_ssl))
178+
self.rp_verify_ssl = to_bool(rp_verify_ssl)
181179
except (ValueError, AttributeError):
182180
self.rp_verify_ssl = rp_verify_ssl
183181
self.rp_launch_timeout = int(
184182
self.find_option(pytest_config, 'rp_launch_timeout'))
185183

186-
self.rp_launch_uuid_print = bool(strtobool(self.find_option(
187-
pytest_config, 'rp_launch_uuid_print'
188-
) or 'False'))
184+
self.rp_launch_uuid_print = to_bool(self.find_option(pytest_config, 'rp_launch_uuid_print') or 'False')
189185
print_output = self.find_option(pytest_config, 'rp_launch_uuid_print_output')
190186
self.rp_launch_uuid_print_output = OutputType[print_output.upper()] if print_output else None
191187
client_type = self.find_option(pytest_config, 'rp_client_type')

pytest_reportportal/service.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,14 +455,18 @@ def _get_code_ref(self, item):
455455
# same path on different systems and do not affect Test Case ID on
456456
# different systems
457457
path = os.path.relpath(str(item.fspath), ROOT_DIR).replace('\\', '/')
458-
method_name = item.originalname if item.originalname is not None \
458+
method_name = item.originalname if hasattr(item, 'originalname') \
459+
and item.originalname is not None \
459460
else item.name
460461
parent = item.parent
461462
classes = [method_name]
462463
while not isinstance(parent, Module):
463-
if not isinstance(parent, Instance):
464+
if not isinstance(parent, Instance) and hasattr(parent, 'name'):
464465
classes.append(parent.name)
465-
parent = parent.parent
466+
if hasattr(parent, 'parent'):
467+
parent = parent.parent
468+
else:
469+
break
466470
classes.reverse()
467471
class_path = '.'.join(classes)
468472
return '{0}:{1}'.format(path, class_path)

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dill>=0.3.6
22
pytest>=3.8.0
3-
reportportal-client~=5.5.4
3+
reportportal-client~=5.5.7
44
aenum>=3.1.0
55
requests>=2.28.0

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from setuptools import setup
1919

2020

21-
__version__ = '5.4.1'
21+
__version__ = '5.4.2'
2222

2323

2424
def read_file(fname):
@@ -51,7 +51,8 @@ def read_file(fname):
5151
'Programming Language :: Python :: 3.8',
5252
'Programming Language :: Python :: 3.9',
5353
'Programming Language :: Python :: 3.10',
54-
'Programming Language :: Python :: 3.11'
54+
'Programming Language :: Python :: 3.11',
55+
'Programming Language :: Python :: 3.12'
5556
],
5657
entry_points={
5758
'pytest11': [

tox.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ envlist =
77
py39
88
py310
99
py311
10+
py312
1011

1112
[testenv]
1213
deps =
@@ -30,3 +31,4 @@ python =
3031
3.9: py39
3132
3.10: py310
3233
3.11: py311
34+
3.12: py312

0 commit comments

Comments
 (0)