mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
Add some private methods to unittest (#2494)
This adds a few stubs that are used by absl-py, and, without them, cause type checker errors under Pytype: * TestCase._formatMessage * TestCase._testMethodName * TestCase._getAssertEqualityFunc * TestProgram.runTests
This commit is contained in:
committed by
Jelle Zijlstra
parent
2d3edbd348
commit
4122a70648
@@ -28,6 +28,8 @@ class TestCase:
|
||||
failureException = ... # type: Type[BaseException]
|
||||
longMessage = ... # type: bool
|
||||
maxDiff = ... # type: Optional[int]
|
||||
# undocumented
|
||||
_testMethodName = ... # type: str
|
||||
def __init__(self, methodName: str = ...) -> None: ...
|
||||
def setUp(self) -> None: ...
|
||||
def tearDown(self) -> None: ...
|
||||
@@ -142,6 +144,8 @@ class TestCase:
|
||||
def addCleanup(self, function: Callable[..., Any], *args: Any,
|
||||
**kwargs: Any) -> None: ...
|
||||
def doCleanups(self) -> None: ...
|
||||
def _formatMessage(self, msg: Optional[str], 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: ...
|
||||
@@ -308,6 +312,7 @@ class TextTestRunner(TestRunner):
|
||||
# not really documented
|
||||
class TestProgram:
|
||||
result = ... # type: TestResult
|
||||
def runTests(self) -> None: ... # undocumented
|
||||
|
||||
def main(module: Union[None, str, ModuleType] = ...,
|
||||
defaultTest: Union[str, Iterable[str], None] = ...,
|
||||
|
||||
Reference in New Issue
Block a user