allure-framework / allure-framework/allure-python
Add type hints for better mypy support
- Vorherrschende Sprache
- Python
- Sterne
- 814
- Forks
- 260
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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.
Beitragsleitfaden
Rechercherichtung
Beginne damit, die im Issue referenzierten allure-Hilfs-APIs und die aktuellen mypy-Fehler in typisierten pytest-Tests zu überprüfen. Kläre, welche Framework-Hilfsfunktionen Annotationen benötigen und wie umfassend die Abdeckung sein sollte; abgeschlossen ist die Aufgabe, wenn typisierte Tests für diese untypisierten Aufrufe keine Wrapper-Funktionen oder globale Unterdrückung mehr benötigen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- testing
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100