adding type-specific assertEqual cases (#315)

Adding support for type-specific equality methods (see https://docs.python.org/2.7/library/unittest.html?highlight=assertlistequals#unittest.TestCase.addTypeEqualityFunc) in the unittest stub for both 2.7/3. As requested by @gvanrossum in #308
This commit is contained in:
Philip House
2016-06-28 10:12:27 -05:00
committed by Guido van Rossum
parent 03326014a5
commit 4a79dec6ba
2 changed files with 26 additions and 10 deletions

View File

@@ -76,9 +76,6 @@ class TestCase(Testable):
msg: object = ...) -> None: ...
def assertNotEqual(self, first: Any, second: Any,
msg: object = ...) -> None: ...
def assertSequenceEqual(self, first: Sequence[Any], second: Sequence[Any],
msg: object = ...,
seq_type: type = ...) -> None: ...
def failIfEqual(self, first: Any, second: Any,
msg: object = ...) -> None: ...
def assertAlmostEqual(self, first: float, second: float, places: int = ...,
@@ -95,9 +92,20 @@ class TestCase(Testable):
def assertGreater(self, first: Any, second: Any,
msg: object = ...) -> None: ...
def assertGreaterEqual(self, first: Any, second: Any,
msg: object = ...) -> None: ...
msg: object = ...) -> None: ...
def assertMultiLineEqual(self, first: str, second: str,
msg: object = ...) -> None: ...
def assertSequenceEqual(self, first: Sequence[Any], second: Sequence[Any],
msg: object = ...,
seq_type: type = ...) -> None: ...
def assertListEqual(self, first: List[Any], second: List[Any],
msg: object = ...) -> None: ...
msg: object = ...) -> None: ...
def assertTupleEqual(self, first: Tuple[Any, ...], second: Tuple[Any, ...],
msg: object = ...) -> None: ...
def assertSetEqual(self, first: Set[Any], second: Set[Any],
msg: object = ...) -> None: ...
def assertDictEqual(self, first: Dict[Any, Any], second: Dict[Any, Any],
msg: object = ...) -> None: ...
def assertLess(self, first: Any, second: Any,
msg: object = ...) -> None: ...
def assertLessEqual(self, first: Any, second: Any,