allure-python icon indicating copy to clipboard operation
allure-python copied to clipboard

Need to add overload functions for allure.step()

Open anci3ntr0ck opened this issue 1 year ago • 2 comments

I'm submitting a ...

  • [x] bug report

What is the current behavior?

VSCode gives an error when using allure.step() as a context: image

Adding overload functions for allure.step() should fix this...

_TFunc = TypeVar("_TFunc", bound=Callable[..., Any])

@overload
def step(title: _TFunc) -> _TFunc: ...
@overload
def step(title: Any) -> StepContext: ...

Please tell us about your environment:

anci3ntr0ck avatar Aug 08 '23 08:08 anci3ntr0ck

Same here! I'm getting this Pylance warning:

Object of type "(...) -> Any" cannot be used with "with" because it does not implement __enter__Pylance(reportGeneralTypeIssues)

rafaelcs avatar Aug 14 '23 13:08 rafaelcs

+1

dc-avasilev avatar Sep 15 '23 11:09 dc-avasilev