Skip to content

Commit 3def6df

Browse files
Fix 'typing.ContextManager' is deprecated, use 'contextlib.AbstractContextManager'
1 parent 0dd6945 commit 3def6df

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/_pytest/python_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from collections.abc import Mapping
77
from collections.abc import Sequence
88
from collections.abc import Sized
9+
from contextlib import AbstractContextManager
910
from decimal import Decimal
1011
import math
1112
from numbers import Complex
@@ -15,7 +16,6 @@
1516
from types import TracebackType
1617
from typing import Any
1718
from typing import cast
18-
from typing import ContextManager
1919
from typing import final
2020
from typing import overload
2121
from typing import TYPE_CHECKING
@@ -978,7 +978,7 @@ def raises(
978978

979979

980980
@final
981-
class RaisesContext(ContextManager[_pytest._code.ExceptionInfo[E]]):
981+
class RaisesContext(AbstractContextManager[_pytest._code.ExceptionInfo[E]]):
982982
def __init__(
983983
self,
984984
expected_exception: type[E] | tuple[type[E], ...],

0 commit comments

Comments
 (0)