Skip to content

Commit

Permalink
Merge pull request #373 from reportportal/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
HardNorth authored Sep 6, 2024
2 parents d537e44 + 097391f commit 33d711f
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11' ]
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11', '3.12' ]
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

## [Unreleased]
### Fixed
- Issue [#368](https://github.com/reportportal/agent-python-pytest/issues/368): Distutils in the agent, by @HardNorth
- Pytest Tavern plugin support, by @virdok
### Added
- Python 12 support, by @HardNorth

## [5.4.1]
### Fixed
- Issue [#362](https://github.com/reportportal/agent-python-pytest/issues/362): Debug mode passing, by @HardNorth

## [5.4.0]
Expand Down
12 changes: 4 additions & 8 deletions pytest_reportportal/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
"""This module contains class that stores RP agent configuration data."""

import warnings
from distutils.util import strtobool
from os import getenv
from typing import Optional, Union, Any, Tuple

from _pytest.config import Config
from reportportal_client import OutputType, ClientType
from reportportal_client.logs import MAX_LOG_BATCH_PAYLOAD_SIZE
from reportportal_client.helpers import to_bool

try:
# This try/except can go away once we support pytest >= 5.4.0
Expand Down Expand Up @@ -116,9 +116,7 @@ def __init__(self, pytest_config: Config) -> None:
self.rp_log_batch_payload_size = MAX_LOG_BATCH_PAYLOAD_SIZE
self.rp_log_level = get_actual_log_level(pytest_config, 'rp_log_level')
self.rp_log_format = self.find_option(pytest_config, 'rp_log_format')
self.rp_thread_logging = bool(strtobool(str(self.find_option(
pytest_config, 'rp_thread_logging'
) or False)))
self.rp_thread_logging = to_bool(self.find_option(pytest_config, 'rp_thread_logging') or False)
self.rp_mode = self.find_option(pytest_config, 'rp_mode')
self.rp_parent_item_id = self.find_option(pytest_config,
'rp_parent_item_id')
Expand Down Expand Up @@ -177,15 +175,13 @@ def __init__(self, pytest_config: Config) -> None:

rp_verify_ssl = self.find_option(pytest_config, 'rp_verify_ssl', True)
try:
self.rp_verify_ssl = bool(strtobool(rp_verify_ssl))
self.rp_verify_ssl = to_bool(rp_verify_ssl)
except (ValueError, AttributeError):
self.rp_verify_ssl = rp_verify_ssl
self.rp_launch_timeout = int(
self.find_option(pytest_config, 'rp_launch_timeout'))

self.rp_launch_uuid_print = bool(strtobool(self.find_option(
pytest_config, 'rp_launch_uuid_print'
) or 'False'))
self.rp_launch_uuid_print = to_bool(self.find_option(pytest_config, 'rp_launch_uuid_print') or 'False')
print_output = self.find_option(pytest_config, 'rp_launch_uuid_print_output')
self.rp_launch_uuid_print_output = OutputType[print_output.upper()] if print_output else None
client_type = self.find_option(pytest_config, 'rp_client_type')
Expand Down
10 changes: 7 additions & 3 deletions pytest_reportportal/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,14 +455,18 @@ def _get_code_ref(self, item):
# same path on different systems and do not affect Test Case ID on
# different systems
path = os.path.relpath(str(item.fspath), ROOT_DIR).replace('\\', '/')
method_name = item.originalname if item.originalname is not None \
method_name = item.originalname if hasattr(item, 'originalname') \
and item.originalname is not None \
else item.name
parent = item.parent
classes = [method_name]
while not isinstance(parent, Module):
if not isinstance(parent, Instance):
if not isinstance(parent, Instance) and hasattr(parent, 'name'):
classes.append(parent.name)
parent = parent.parent
if hasattr(parent, 'parent'):
parent = parent.parent
else:
break
classes.reverse()
class_path = '.'.join(classes)
return '{0}:{1}'.format(path, class_path)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dill>=0.3.6
pytest>=3.8.0
reportportal-client~=5.5.4
reportportal-client~=5.5.7
aenum>=3.1.0
requests>=2.28.0
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from setuptools import setup


__version__ = '5.4.1'
__version__ = '5.4.2'


def read_file(fname):
Expand Down Expand Up @@ -51,7 +51,8 @@ def read_file(fname):
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11'
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12'
],
entry_points={
'pytest11': [
Expand Down
2 changes: 2 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ envlist =
py39
py310
py311
py312

[testenv]
deps =
Expand All @@ -30,3 +31,4 @@ python =
3.9: py39
3.10: py310
3.11: py311
3.12: py312

0 comments on commit 33d711f

Please sign in to comment.