Improve type of tornado.testing.gen_test. (#3174)

gen_test can accept a timeout parameter. See https://www.tornadoweb.org/en/branch5.1/testing.html#tornado.testing.gen_test.
This commit is contained in:
Benjamin Peterson
2019-08-10 13:08:59 -07:00
committed by Jelle Zijlstra
parent 628eee29f7
commit 0dc3bf941a

View File

@@ -1,4 +1,4 @@
from typing import Any, Optional
from typing import Any, Callable, Generator, Optional, overload
import unittest
import logging
@@ -42,7 +42,13 @@ class AsyncHTTPSTestCase(AsyncHTTPTestCase):
def get_ssl_options(self): ...
def get_protocol(self): ...
def gen_test(f): ...
@overload
def gen_test(*, timeout: Optional[float] = ...) -> Callable[[Callable[..., Generator]], Callable[..., None]]:
...
@overload
def gen_test(func: Callable[..., Generator]) -> Callable[..., None]:
...
class LogTrapTestCase(unittest.TestCase):
def run(self, result: Optional[Any] = ...): ...