mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
bpo-38614: Use test.support.LOOPBACK_TIMEOUT constant (GH-17554)
Replace hardcoded timeout constants in tests with LOOPBACK_TIMEOUT of test.support, so it's easier to ajdust this timeout for all tests at once.
This commit is contained in:
parent
680068c288
commit
07871b256c
10 changed files with 71 additions and 42 deletions
|
@ -7,6 +7,7 @@ import select
|
|||
import socket
|
||||
import tempfile
|
||||
import threading
|
||||
from test import support
|
||||
|
||||
|
||||
class FunctionalTestCaseMixin:
|
||||
|
@ -49,7 +50,7 @@ class FunctionalTestCaseMixin:
|
|||
def tcp_server(self, server_prog, *,
|
||||
family=socket.AF_INET,
|
||||
addr=None,
|
||||
timeout=5,
|
||||
timeout=support.LOOPBACK_TIMEOUT,
|
||||
backlog=1,
|
||||
max_clients=10):
|
||||
|
||||
|
@ -72,7 +73,7 @@ class FunctionalTestCaseMixin:
|
|||
|
||||
def tcp_client(self, client_prog,
|
||||
family=socket.AF_INET,
|
||||
timeout=10):
|
||||
timeout=support.LOOPBACK_TIMEOUT):
|
||||
|
||||
sock = socket.socket(family, socket.SOCK_STREAM)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue