From 4781cde3e28ccc11a69ba99f11323954fae58973 Mon Sep 17 00:00:00 2001 From: Maksim Stepanov <17935127+delatrie@users.noreply.github.com> Date: Thu, 27 Mar 2025 15:54:58 +0700 Subject: [PATCH 1/2] refactor(commons): remove redundant types from step impl --- allure-python-commons/src/_allure.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/allure-python-commons/src/_allure.py b/allure-python-commons/src/_allure.py index 31b2e38e..8b6533e1 100644 --- a/allure-python-commons/src/_allure.py +++ b/allure-python-commons/src/_allure.py @@ -1,5 +1,5 @@ from functools import wraps -from typing import Any, Callable, TypeVar, Union, overload +from typing import Any, Callable, TypeVar, overload from allure_commons._core import plugin_manager from allure_commons.types import LabelType, LinkType, ParameterMode @@ -162,14 +162,16 @@ def manual(): @overload -def step(title: str) -> "StepContext": ... +def step(title: str) -> "StepContext": + ... @overload -def step(title: _TFunc) -> _TFunc: ... +def step(title: _TFunc) -> _TFunc: + ... -def step(title: Union[str, _TFunc]) -> Union["StepContext", _TFunc]: +def step(title): if callable(title): return StepContext(title.__name__, {})(title) else: From 6eb7010b665d2a2559d1d26aa401dee6a672fbb1 Mon Sep 17 00:00:00 2001 From: Maksim Stepanov <17935127+delatrie@users.noreply.github.com> Date: Thu, 27 Mar 2025 15:56:08 +0700 Subject: [PATCH 2/2] chore(commons): ignore step wrapper typing error --- allure-python-commons/src/_allure.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/allure-python-commons/src/_allure.py b/allure-python-commons/src/_allure.py index 8b6533e1..4776f81b 100644 --- a/allure-python-commons/src/_allure.py +++ b/allure-python-commons/src/_allure.py @@ -201,7 +201,7 @@ def impl(*a, **kw): with StepContext(self.title.format(*args, **params), params): return func(*a, **kw) - return impl + return impl # type: ignore class Attach: