allure-framework / allure-framework/allure-python

Add type hints for better mypy support

Open
#878 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
814
Forks
260
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.