Skip to content

Commit 4f682c1

Browse files
committed
fix rtd
1 parent 753df94 commit 4f682c1

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/_pytest/python_api.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@
1717
from typing import TYPE_CHECKING
1818
from typing import TypeVar
1919

20-
import _pytest._code
2120
from _pytest.outcomes import fail
22-
from _pytest.raises_group import BaseExcT_co_default
2321
from _pytest.raises_group import RaisesExc
22+
from pytest import ExceptionInfo
2423

2524

2625
if sys.version_info < (3, 11):
@@ -797,7 +796,7 @@ def raises(
797796
expected_exception: type[E] | tuple[type[E], ...],
798797
*,
799798
match: str | re.Pattern[str] | None = ...,
800-
check: Callable[[BaseExcT_co_default], bool] = ...,
799+
check: Callable[[E], bool] = ...,
801800
) -> RaisesExc[E]: ...
802801

803802

@@ -820,14 +819,14 @@ def raises(
820819
func: Callable[..., Any],
821820
*args: Any,
822821
**kwargs: Any,
823-
) -> _pytest._code.ExceptionInfo[E]: ...
822+
) -> ExceptionInfo[E]: ...
824823

825824

826825
def raises(
827826
expected_exception: type[E] | tuple[type[E], ...] | None = None,
828827
*args: Any,
829828
**kwargs: Any,
830-
) -> RaisesExc[BaseException] | _pytest._code.ExceptionInfo[E]:
829+
) -> RaisesExc[BaseException] | ExceptionInfo[E]:
831830
r"""Assert that a code block/function call raises an exception type, or one of its subclasses.
832831
833832
:param expected_exception:

src/_pytest/raises_group.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
from typing import TYPE_CHECKING
1818
import warnings
1919

20-
from _pytest._code import ExceptionInfo
2120
from _pytest._code.code import stringify_exception
2221
from _pytest.outcomes import fail
2322
from _pytest.warning_types import PytestWarning
23+
from pytest import ExceptionInfo
2424

2525

2626
if TYPE_CHECKING:

0 commit comments

Comments
 (0)