Skip to content

Commit 1a73e78

Browse files
committed
mark: fix typing for @pytest.mark.xfail(raises=...)
1 parent 7f7a364 commit 1a73e78

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/_pytest/mark/structures.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
from _pytest.outcomes import fail
2929
from _pytest.warning_types import PytestUnknownMarkWarning
3030

31+
if TYPE_CHECKING:
32+
from typing import Type
33+
3134

3235
EMPTY_PARAMETERSET_OPTION = "empty_parameter_set_mark"
3336

@@ -413,7 +416,9 @@ def __call__( # noqa: F811
413416
*conditions: Union[str, bool],
414417
reason: str = ...,
415418
run: bool = ...,
416-
raises: Union[BaseException, Tuple[BaseException, ...]] = ...,
419+
raises: Union[
420+
"Type[BaseException]", Tuple["Type[BaseException]", ...]
421+
] = ...,
417422
strict: bool = ...
418423
) -> MarkDecorator:
419424
raise NotImplementedError()

0 commit comments

Comments
 (0)