2020import time as datetime
2121import warnings
2222from os import getenv
23- from typing import Any , Coroutine , Dict , List , Optional , Tuple , TypeVar , Union
23+ from typing import Any , Coroutine , Optional , TypeVar , Union
2424
2525import aiohttp
2626import certifi
@@ -115,7 +115,7 @@ class Client:
115115 verify_ssl : Union [bool , str ]
116116 retries : Optional [int ]
117117 max_pool_size : int
118- http_timeout : Optional [Union [float , Tuple [float , float ]]]
118+ http_timeout : Optional [Union [float , tuple [float , float ]]]
119119 keepalive_timeout : Optional [float ]
120120 mode : str
121121 launch_uuid_print : bool
@@ -135,7 +135,7 @@ def __init__(
135135 verify_ssl : Union [bool , str ] = True ,
136136 retries : int = NOT_SET ,
137137 max_pool_size : int = 50 ,
138- http_timeout : Optional [Union [float , Tuple [float , float ]]] = (10 , 10 ),
138+ http_timeout : Optional [Union [float , tuple [float , float ]]] = (10 , 10 ),
139139 keepalive_timeout : Optional [float ] = None ,
140140 mode : str = "DEFAULT" ,
141141 launch_uuid_print : bool = False ,
@@ -259,12 +259,12 @@ async def session(self) -> ClientSession:
259259 else :
260260 ssl_config = ssl .create_default_context (ssl .Purpose .SERVER_AUTH , cafile = certifi .where ())
261261
262- connection_params : Dict [str , Any ] = {"ssl" : ssl_config , "limit" : self .max_pool_size }
262+ connection_params : dict [str , Any ] = {"ssl" : ssl_config , "limit" : self .max_pool_size }
263263 if self .keepalive_timeout :
264264 connection_params ["keepalive_timeout" ] = self .keepalive_timeout
265265 connector = aiohttp .TCPConnector (** connection_params )
266266
267- session_params : Dict [str , Any ] = {"connector" : connector }
267+ session_params : dict [str , Any ] = {"connector" : connector }
268268
269269 if self .http_timeout :
270270 if type (self .http_timeout ) is tuple :
@@ -366,7 +366,7 @@ async def start_test_item(
366366 * ,
367367 parent_item_id : Optional [Union [str , Task [str ]]] = None ,
368368 description : Optional [str ] = None ,
369- attributes : Optional [Union [List [dict ], dict ]] = None ,
369+ attributes : Optional [Union [list [dict ], dict ]] = None ,
370370 parameters : Optional [dict ] = None ,
371371 code_ref : Optional [str ] = None ,
372372 test_case_id : Optional [str ] = None ,
@@ -629,7 +629,7 @@ async def get_project_settings(self) -> Optional[dict]:
629629 response = await AsyncHttpRequest ((await self .session ()).get , url = url , name = "get_project_settings" ).make ()
630630 return await response .json if response else None
631631
632- async def log_batch (self , log_batch : Optional [List [AsyncRPRequestLog ]]) -> Optional [Tuple [str , ...]]:
632+ async def log_batch (self , log_batch : Optional [list [AsyncRPRequestLog ]]) -> Optional [tuple [str , ...]]:
633633 """Send batch logging message to the ReportPortal.
634634
635635 :param log_batch: A list of log message objects.
@@ -672,7 +672,7 @@ def clone(self) -> "Client":
672672 )
673673 return cloned
674674
675- def __getstate__ (self ) -> Dict [str , Any ]:
675+ def __getstate__ (self ) -> dict [str , Any ]:
676676 """Control object pickling and return object fields as Dictionary.
677677
678678 :return: object state dictionary
@@ -683,7 +683,7 @@ def __getstate__(self) -> Dict[str, Any]:
683683 del state ["_session" ]
684684 return state
685685
686- def __setstate__ (self , state : Dict [str , Any ]) -> None :
686+ def __setstate__ (self , state : dict [str , Any ]) -> None :
687687 """Control object pickling, receives object state as Dictionary.
688688
689689 :param dict state: object state dictionary
@@ -847,7 +847,7 @@ async def start_test_item(
847847 start_time : str ,
848848 item_type : str ,
849849 description : Optional [str ] = None ,
850- attributes : Optional [List [dict ]] = None ,
850+ attributes : Optional [list [dict ]] = None ,
851851 parameters : Optional [dict ] = None ,
852852 parent_item_id : Optional [str ] = None ,
853853 has_stats : bool = True ,
@@ -1047,7 +1047,7 @@ async def log(
10471047 level : Optional [Union [int , str ]] = None ,
10481048 attachment : Optional [dict ] = None ,
10491049 item_id : Optional [str ] = None ,
1050- ) -> Optional [Tuple [str , ...]]:
1050+ ) -> Optional [tuple [str , ...]]:
10511051 """Send Log message to the ReportPortal and attach it to a Test Item or Launch.
10521052
10531053 This method stores Log messages in internal batch and sent it when batch is full, so not every method
@@ -1293,7 +1293,7 @@ def start_test_item(
12931293 start_time : str ,
12941294 item_type : str ,
12951295 description : Optional [str ] = None ,
1296- attributes : Optional [List [dict ]] = None ,
1296+ attributes : Optional [list [dict ]] = None ,
12971297 parameters : Optional [dict ] = None ,
12981298 parent_item_id : Optional [Task [str ]] = None ,
12991299 has_stats : bool = True ,
@@ -1485,10 +1485,10 @@ def get_project_settings(self) -> Task[Optional[str]]:
14851485 result_task = self .create_task (result_coro )
14861486 return result_task
14871487
1488- async def _log_batch (self , log_rq : Optional [List [AsyncRPRequestLog ]]) -> Optional [Tuple [str , ...]]:
1488+ async def _log_batch (self , log_rq : Optional [list [AsyncRPRequestLog ]]) -> Optional [tuple [str , ...]]:
14891489 return await self .__client .log_batch (log_rq )
14901490
1491- async def _log (self , log_rq : AsyncRPRequestLog ) -> Optional [Tuple [str , ...]]:
1491+ async def _log (self , log_rq : AsyncRPRequestLog ) -> Optional [tuple [str , ...]]:
14921492 return await self ._log_batch (await self ._log_batcher .append_async (log_rq ))
14931493
14941494 def log (
@@ -1498,7 +1498,7 @@ def log(
14981498 level : Optional [Union [int , str ]] = None ,
14991499 attachment : Optional [dict ] = None ,
15001500 item_id : Optional [Task [str ]] = None ,
1501- ) -> Task [Optional [Tuple [str , ...]]]:
1501+ ) -> Task [Optional [tuple [str , ...]]]:
15021502 """Send Log message to the ReportPortal and attach it to a Test Item or Launch.
15031503
15041504 This method stores Log messages in internal batch and sent it when batch is full, so not every method
@@ -1697,7 +1697,7 @@ def clone(self) -> "ThreadedRPClient":
16971697 cloned ._add_current_item (current_item )
16981698 return cloned
16991699
1700- def __getstate__ (self ) -> Dict [str , Any ]:
1700+ def __getstate__ (self ) -> dict [str , Any ]:
17011701 """Control object pickling and return object fields as Dictionary.
17021702
17031703 :return: object state dictionary
@@ -1710,7 +1710,7 @@ def __getstate__(self) -> Dict[str, Any]:
17101710 del state ["_thread" ]
17111711 return state
17121712
1713- def __setstate__ (self , state : Dict [str , Any ]) -> None :
1713+ def __setstate__ (self , state : dict [str , Any ]) -> None :
17141714 """Control object pickling, receives object state as Dictionary.
17151715
17161716 :param dict state: object state dictionary
@@ -1889,7 +1889,7 @@ def clone(self) -> "BatchedRPClient":
18891889 cloned ._add_current_item (current_item )
18901890 return cloned
18911891
1892- def __getstate__ (self ) -> Dict [str , Any ]:
1892+ def __getstate__ (self ) -> dict [str , Any ]:
18931893 """Control object pickling and return object fields as Dictionary.
18941894
18951895 :return: object state dictionary
@@ -1901,7 +1901,7 @@ def __getstate__(self) -> Dict[str, Any]:
19011901 del state ["_loop" ]
19021902 return state
19031903
1904- def __setstate__ (self , state : Dict [str , Any ]) -> None :
1904+ def __setstate__ (self , state : dict [str , Any ]) -> None :
19051905 """Control object pickling, receives object state as Dictionary.
19061906
19071907 :param dict state: object state dictionary
0 commit comments