allure-framework / allure-framework/allure-python

Add type hints for better mypy support

オープン
#878 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
814
フォーク
260
PR マージ指標
30日以内にマージされた PR はありません

説明

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.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず、issue で参照されている allure ヘルパー API と、型付き pytest テストにおける現在の mypy エラーを確認します。どの framework ヘルパーにアノテーションが必要か、またカバレッジをどこまで広げるべきかを明確にします。これらの型付けされていない呼び出しについて、型付きテストでラッパー関数やグローバルな抑制が不要になれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
testing
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。