Make unittest.removeHandler() an overloaded function.

See https://docs.python.org/3/library/unittest.html#unittest.removeHandler

- Without args it removes the signal handler.
- With a function arg it is a test decorator that temporarily removes
  the handler while the test is running.
This commit is contained in:
Guido van Rossum
2017-01-01 17:24:28 -08:00
committed by Łukasz Langa
parent f775ef3bc5
commit b78eb48b26

View File

@@ -327,4 +327,7 @@ def main(module: str = ..., defaultTest: _DefaultTestType = ...,
def installHandler() -> None: ...
def registerResult(result: TestResult) -> None: ...
def removeResult(result: TestResult) -> None: ...
def removeHandler(function: Optional[_FT]) -> _FT: ...
@overload
def removeHandler() -> None: ...
@overload
def removeHandler(function: _FT) -> _FT: ...