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

[Feature request] Make `StepContext` available in public API for annotations

Open gryznar opened this issue 1 year ago • 0 comments

I'm submitting a ...

  • [x] feature request

What is the current behavior?

def allure_step__foo(content: str):
    return allure.step(content)

Annotating return type of such function is not possible, because allure.step returns internal StepContext (under _allure.py)

What is the expected behavior?

Make StepContext available in allure.py

What is the motivation / use case for changing the behavior?

Adding StepContext to public API will allow to annotate return type of allure_step__foo in a nice and simple way via:

def allure_step__foo(content: str) -> StepContext: ...

gryznar avatar Feb 08 '24 08:02 gryznar