Resolve an (host, port) to an address. We must perform name resolution before timeout tests, otherwise it will be performed by connect().
(host, port)
| 12 | |
| 13 | @functools.lru_cache() |
| 14 | def resolve_address(host, port): |
| 15 | """Resolve an (host, port) to an address. |
| 16 | |
| 17 | We must perform name resolution before timeout tests, otherwise it will be |
| 18 | performed by connect(). |
| 19 | """ |
| 20 | with socket_helper.transient_internet(host): |
| 21 | return socket.getaddrinfo(host, port, socket.AF_INET, |
| 22 | socket.SOCK_STREAM)[0][4] |
| 23 | |
| 24 | |
| 25 | class CreationTestCase(unittest.TestCase): |
no test coverage detected
searching dependent graphs…