17
17
from typing import TYPE_CHECKING
18
18
from typing import TypeVar
19
19
20
- import _pytest ._code
21
20
from _pytest .outcomes import fail
22
- from _pytest .raises_group import BaseExcT_co_default
23
21
from _pytest .raises_group import RaisesExc
22
+ from pytest import ExceptionInfo
24
23
25
24
26
25
if sys .version_info < (3 , 11 ):
@@ -797,7 +796,7 @@ def raises(
797
796
expected_exception : type [E ] | tuple [type [E ], ...],
798
797
* ,
799
798
match : str | re .Pattern [str ] | None = ...,
800
- check : Callable [[BaseExcT_co_default ], bool ] = ...,
799
+ check : Callable [[E ], bool ] = ...,
801
800
) -> RaisesExc [E ]: ...
802
801
803
802
@@ -820,14 +819,14 @@ def raises(
820
819
func : Callable [..., Any ],
821
820
* args : Any ,
822
821
** kwargs : Any ,
823
- ) -> _pytest . _code . ExceptionInfo [E ]: ...
822
+ ) -> ExceptionInfo [E ]: ...
824
823
825
824
826
825
def raises (
827
826
expected_exception : type [E ] | tuple [type [E ], ...] | None = None ,
828
827
* args : Any ,
829
828
** kwargs : Any ,
830
- ) -> RaisesExc [BaseException ] | _pytest . _code . ExceptionInfo [E ]:
829
+ ) -> RaisesExc [BaseException ] | ExceptionInfo [E ]:
831
830
r"""Assert that a code block/function call raises an exception type, or one of its subclasses.
832
831
833
832
:param expected_exception:
0 commit comments