From 41a605e2e7aed7fb89177e6eda897a5a79a1f15a Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Wed, 4 Dec 2024 17:36:30 +0300 Subject: [PATCH] A try to fix circular import --- reportportal_client/steps/__init__.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/reportportal_client/steps/__init__.py b/reportportal_client/steps/__init__.py index b227848..dd4ced5 100644 --- a/reportportal_client/steps/__init__.py +++ b/reportportal_client/steps/__init__.py @@ -45,7 +45,7 @@ def test_my_nested_step(): from functools import wraps from typing import Callable, ParamSpec, TypeVar, Optional, Dict, Union, Type -from reportportal_client import RP +import reportportal_client as rp # noinspection PyProtectedMember from reportportal_client._internal.aio.tasks import Task # noinspection PyProtectedMember @@ -63,9 +63,9 @@ def test_my_nested_step(): class StepReporter: """Nested Steps context handling class.""" - client: RP + client: rp.RP - def __init__(self, rp_client: RP): + def __init__(self, rp_client: rp.RP): """Initialize required attributes. :param rp_client: ReportPortal client which will be used to report @@ -104,10 +104,10 @@ class Step(Callable[[_Param], _Return]): name: str params: Dict status: str - client: Optional[RP] + client: Optional[rp.RP] __item_id: Union[Optional[str], Task[Optional[str]]] - def __init__(self, name: str, params: Dict, status: str, rp_client: Optional[RP]): + def __init__(self, name: str, params: Dict, status: str, rp_client: Optional[rp.RP]) -> None: """Initialize required attributes. :param name: Nested Step name @@ -173,7 +173,7 @@ def wrapper(*my_args, **my_kwargs): def step(name_source: Union[Callable[[_Param], _Return], str], params: Optional[Dict] = None, status: str = 'PASSED', - rp_client: Optional[RP] = None) -> Callable[[_Param], _Return]: + rp_client: Optional[rp.RP] = None) -> Callable[[_Param], _Return]: """Nested step report function. Create a Nested Step inside a test method on ReportPortal.