mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
Revise unittest stub to reflect removed methods in 3.11 (#6373)
This commit is contained in:
@@ -186,49 +186,53 @@ class TestCase:
|
||||
def doClassCleanups(cls) -> None: ...
|
||||
def _formatMessage(self, msg: str | None, standardMsg: str) -> str: ... # undocumented
|
||||
def _getAssertEqualityFunc(self, first: Any, second: Any) -> Callable[..., None]: ... # undocumented
|
||||
# below is deprecated
|
||||
def failUnlessEqual(self, first: Any, second: Any, msg: Any = ...) -> None: ...
|
||||
def assertEquals(self, first: Any, second: Any, msg: Any = ...) -> None: ...
|
||||
def failIfEqual(self, first: Any, second: Any, msg: Any = ...) -> None: ...
|
||||
def assertNotEquals(self, first: Any, second: Any, msg: Any = ...) -> None: ...
|
||||
def failUnless(self, expr: bool, msg: Any = ...) -> None: ...
|
||||
def assert_(self, expr: bool, msg: Any = ...) -> None: ...
|
||||
def failIf(self, expr: bool, msg: Any = ...) -> None: ...
|
||||
@overload
|
||||
def failUnlessRaises( # type: ignore
|
||||
self,
|
||||
exception: Type[BaseException] | Tuple[Type[BaseException], ...],
|
||||
callable: Callable[..., Any] = ...,
|
||||
*args: Any,
|
||||
**kwargs: Any,
|
||||
) -> None: ...
|
||||
@overload
|
||||
def failUnlessRaises(self, exception: Type[_E] | Tuple[Type[_E], ...], msg: Any = ...) -> _AssertRaisesContext[_E]: ...
|
||||
def failUnlessAlmostEqual(self, first: float, second: float, places: int = ..., msg: Any = ...) -> None: ...
|
||||
def assertAlmostEquals(self, first: float, second: float, places: int = ..., msg: Any = ..., delta: float = ...) -> None: ...
|
||||
def failIfAlmostEqual(self, first: float, second: float, places: int = ..., msg: Any = ...) -> None: ...
|
||||
def assertNotAlmostEquals(
|
||||
self, first: float, second: float, places: int = ..., msg: Any = ..., delta: float = ...
|
||||
) -> None: ...
|
||||
def assertRegexpMatches(self, text: AnyStr, regex: AnyStr | Pattern[AnyStr], msg: Any = ...) -> None: ...
|
||||
def assertNotRegexpMatches(self, text: AnyStr, regex: AnyStr | Pattern[AnyStr], msg: Any = ...) -> None: ...
|
||||
@overload
|
||||
def assertRaisesRegexp( # type: ignore
|
||||
self,
|
||||
exception: Type[BaseException] | Tuple[Type[BaseException], ...],
|
||||
expected_regex: str | bytes | Pattern[str] | Pattern[bytes],
|
||||
callable: Callable[..., Any],
|
||||
*args: Any,
|
||||
**kwargs: Any,
|
||||
) -> None: ...
|
||||
@overload
|
||||
def assertRaisesRegexp(
|
||||
self,
|
||||
exception: Type[_E] | Tuple[Type[_E], ...],
|
||||
expected_regex: str | bytes | Pattern[str] | Pattern[bytes],
|
||||
msg: Any = ...,
|
||||
) -> _AssertRaisesContext[_E]: ...
|
||||
def assertDictContainsSubset(self, subset: Mapping[Any, Any], dictionary: Mapping[Any, Any], msg: object = ...) -> None: ...
|
||||
if sys.version_info < (3, 11):
|
||||
def failUnlessEqual(self, first: Any, second: Any, msg: Any = ...) -> None: ...
|
||||
def assertEquals(self, first: Any, second: Any, msg: Any = ...) -> None: ...
|
||||
def failIfEqual(self, first: Any, second: Any, msg: Any = ...) -> None: ...
|
||||
def assertNotEquals(self, first: Any, second: Any, msg: Any = ...) -> None: ...
|
||||
def failUnless(self, expr: bool, msg: Any = ...) -> None: ...
|
||||
def assert_(self, expr: bool, msg: Any = ...) -> None: ...
|
||||
def failIf(self, expr: bool, msg: Any = ...) -> None: ...
|
||||
@overload
|
||||
def failUnlessRaises( # type: ignore
|
||||
self,
|
||||
exception: Type[BaseException] | Tuple[Type[BaseException], ...],
|
||||
callable: Callable[..., Any] = ...,
|
||||
*args: Any,
|
||||
**kwargs: Any,
|
||||
) -> None: ...
|
||||
@overload
|
||||
def failUnlessRaises(self, exception: Type[_E] | Tuple[Type[_E], ...], msg: Any = ...) -> _AssertRaisesContext[_E]: ...
|
||||
def failUnlessAlmostEqual(self, first: float, second: float, places: int = ..., msg: Any = ...) -> None: ...
|
||||
def assertAlmostEquals(
|
||||
self, first: float, second: float, places: int = ..., msg: Any = ..., delta: float = ...
|
||||
) -> None: ...
|
||||
def failIfAlmostEqual(self, first: float, second: float, places: int = ..., msg: Any = ...) -> None: ...
|
||||
def assertNotAlmostEquals(
|
||||
self, first: float, second: float, places: int = ..., msg: Any = ..., delta: float = ...
|
||||
) -> None: ...
|
||||
def assertRegexpMatches(self, text: AnyStr, regex: AnyStr | Pattern[AnyStr], msg: Any = ...) -> None: ...
|
||||
def assertNotRegexpMatches(self, text: AnyStr, regex: AnyStr | Pattern[AnyStr], msg: Any = ...) -> None: ...
|
||||
@overload
|
||||
def assertRaisesRegexp( # type: ignore
|
||||
self,
|
||||
exception: Type[BaseException] | Tuple[Type[BaseException], ...],
|
||||
expected_regex: str | bytes | Pattern[str] | Pattern[bytes],
|
||||
callable: Callable[..., Any],
|
||||
*args: Any,
|
||||
**kwargs: Any,
|
||||
) -> None: ...
|
||||
@overload
|
||||
def assertRaisesRegexp(
|
||||
self,
|
||||
exception: Type[_E] | Tuple[Type[_E], ...],
|
||||
expected_regex: str | bytes | Pattern[str] | Pattern[bytes],
|
||||
msg: Any = ...,
|
||||
) -> _AssertRaisesContext[_E]: ...
|
||||
def assertDictContainsSubset(
|
||||
self, subset: Mapping[Any, Any], dictionary: Mapping[Any, Any], msg: object = ...
|
||||
) -> None: ...
|
||||
|
||||
class FunctionTestCase(TestCase):
|
||||
def __init__(
|
||||
|
||||
Reference in New Issue
Block a user