Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13', '3.14', '3.15' ]
python-version: [ '3.10', '3.11', '3.12', '3.13', '3.14', '3.15' ]
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Changelog

## [Unreleased]
### Fixed
- Issue [#283](https://github.com/reportportal/client-Python/issues/283): Async RPClient doesn't close client session, by @BlueX888
### Removed
- `Python 3.9` support, by @HardNorth

## [5.7.12]
### Changed
- `certify` version range updated to mitigate a compromised certificate issue, by @HardNorth

Expand Down
1 change: 0 additions & 1 deletion reportportal_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from enum import Enum
from typing import Optional, TypedDict, Union

# noinspection PyUnreachableCode
if sys.version_info >= (3, 11):
from typing import Unpack
else:
Expand Down
7 changes: 1 addition & 6 deletions reportportal_client/_internal/aio/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,10 @@
import sys
import time
from asyncio import Future
from typing import Any, Coroutine, Generator, Generic, Optional, TypeVar, Union
from typing import Any, Coroutine, Generator, Generic, Optional, TypeAlias, TypeVar, Union

from reportportal_client.aio.tasks import BlockingOperationError, Task

if sys.version_info >= (3, 10):
from typing import TypeAlias
else:
from typing_extensions import TypeAlias

_T = TypeVar("_T")

DEFAULT_TASK_TRIGGER_NUM: int = 10
Expand Down
3 changes: 2 additions & 1 deletion reportportal_client/aio/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,7 @@ def __setstate__(self, state: dict[str, Any]) -> None:
:param dict state: object state dictionary
"""
self.__dict__.update(state)
self._session = None


class AsyncRPClient(RP):
Expand Down Expand Up @@ -1365,7 +1366,7 @@ def __init__(
self.own_client = False
else:
self.__client = Client(endpoint, project, **kwargs)
self.own_client = False
self.own_client = True

self.__launch_uuid = launch_uuid
if launch_uuid:
Expand Down
7 changes: 1 addition & 6 deletions reportportal_client/aio/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,7 @@
import sys
from abc import abstractmethod
from asyncio import Future
from typing import Any, Coroutine, Generator, Generic, Optional, TypeVar, Union

if sys.version_info >= (3, 10):
from typing import TypeAlias
else:
from typing_extensions import TypeAlias
from typing import Any, Coroutine, Generator, Generic, Optional, TypeAlias, TypeVar, Union

# noinspection PyProtectedMember
from reportportal_client._internal.static.abstract import AbstractBaseClass
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from setuptools import find_packages, setup

__version__ = "5.7.12"
__version__ = "5.8.0"

TYPE_STUBS = ["*.pyi"]

Expand Down Expand Up @@ -39,7 +39,6 @@ def read_file(fname):
license="Apache-2.0",
keywords=["testing", "reporting", "reportportal", "client"],
classifiers=[
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
Expand Down
13 changes: 12 additions & 1 deletion tests/aio/test_batched_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,27 @@
# noinspection PyPackageRequirements
import pytest

from reportportal_client.aio import BatchedRPClient
from reportportal_client.aio import BatchedRPClient, ThreadedRPClient
from reportportal_client.core.rp_requests import AsyncRPRequestLog
from reportportal_client.helpers import timestamp


@pytest.mark.parametrize("client_class", [BatchedRPClient, ThreadedRPClient])
def test_own_client_reflects_client_ownership(client_class):
owned = client_class("http://endpoint", "project", api_key="api_key")
assert owned.own_client is True

borrowed = client_class("http://endpoint", "project", api_key="api_key", client=mock.AsyncMock())
assert borrowed.own_client is False


def test_batched_rp_client_pickling():
client = BatchedRPClient("http://localhost:8080", "default_personal", api_key="test_key")
pickled_client = pickle.dumps(client)
unpickled_client = pickle.loads(pickled_client)
assert unpickled_client is not None
assert unpickled_client.own_client is True
unpickled_client.close()


async def __empty_string():
Expand Down
2 changes: 0 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
isolated_build = True
envlist =
pep
py39
py310
py311
py312
Expand Down Expand Up @@ -31,7 +30,6 @@ commands = pre-commit run --all-files --show-diff-on-failure

[gh-actions]
python =
3.9: py39
3.10: pep, py310
3.11: py311
3.12: py312
Expand Down
Loading