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

Add type hints for better mypy support

Open funkindy opened this issue 4 months ago • 0 comments

Hello!

We use mypy to type check our pytest tests. So we have to use wrappers for allure helpers, e.g.

from collections.abc import Callable
from typing import Any, TypeVar, cast

import allure

F = TypeVar('F', bound=Callable[..., Any])


def epic(*items: str) -> Callable[[F], F]:
    return cast('Callable[[F], F]', allure.epic(*items))  # type: ignore[no-untyped-call]


def tag(*tags: str) -> Callable[[F], F]:
    return cast('Callable[[F], F]', allure.tag(*tags))  # type: ignore[no-untyped-call]

... and so on

or even use global mute for untyped calls in typed context.

Can you please clarify if there are any plans to introduce type hints into framework?

Thank you.

funkindy avatar Sep 30 '25 14:09 funkindy