Skip to content

Commit e9003d0

Browse files
authored
chore(commons): tiny fixes of step type checking (#846)
1 parent d5a7a20 commit e9003d0

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

allure-python-commons/src/_allure.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from functools import wraps
2-
from typing import Any, Callable, TypeVar, Union, overload
2+
from typing import Any, Callable, TypeVar, overload
33

44
from allure_commons._core import plugin_manager
55
from allure_commons.types import LabelType, LinkType, ParameterMode
@@ -162,14 +162,16 @@ def manual():
162162

163163

164164
@overload
165-
def step(title: str) -> "StepContext": ...
165+
def step(title: str) -> "StepContext":
166+
...
166167

167168

168169
@overload
169-
def step(title: _TFunc) -> _TFunc: ...
170+
def step(title: _TFunc) -> _TFunc:
171+
...
170172

171173

172-
def step(title: Union[str, _TFunc]) -> Union["StepContext", _TFunc]:
174+
def step(title):
173175
if callable(title):
174176
return StepContext(title.__name__, {})(title)
175177
else:
@@ -199,7 +201,7 @@ def impl(*a, **kw):
199201
with StepContext(self.title.format(*args, **params), params):
200202
return func(*a, **kw)
201203

202-
return impl
204+
return impl # type: ignore
203205

204206

205207
class Attach:

0 commit comments

Comments
 (0)