summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-04-20 00:55:39 (GMT)
committerGitHub <noreply@github.com>2017-04-20 00:55:39 (GMT)
commit11470b6dcdbc170779499a4a040b93c842a0d194 (patch)
tree3cf30479da144f5baf58054391c74b5296eb6492 /Lib
parentd13d54748d3a7db023d9db37223ea7d40bb8f8e3 (diff)
downloadcpython-11470b6dcdbc170779499a4a040b93c842a0d194.zip
cpython-11470b6dcdbc170779499a4a040b93c842a0d194.tar.gz
cpython-11470b6dcdbc170779499a4a040b93c842a0d194.tar.bz2
bpo-30106: Fix tearDown() of test_asyncore (#1194)
Call asyncore.close_all() with ignore_all=True in the tearDown() method of the test_asyncore base test case. It should prevent keeping alive sockets in asyncore.socket_map if close() fails with an unexpected error. Revert also an unwanted change of my previous commit: remove name parameter of Thread in test_quick_connect().
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_asyncore.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_asyncore.py b/Lib/test/test_asyncore.py
index 270e9cc..1e276ec 100644
--- a/Lib/test/test_asyncore.py
+++ b/Lib/test/test_asyncore.py
@@ -502,7 +502,7 @@ class BaseClient(BaseTestHandler):
class BaseTestAPI:
def tearDown(self):
- asyncore.close_all()
+ asyncore.close_all(ignore_all=True)
def loop_waiting_for_flag(self, instance, timeout=5):
timeout = float(timeout) / 100
@@ -782,7 +782,7 @@ class BaseTestAPI:
server = BaseServer(self.family, self.addr)
t = threading.Thread(target=lambda: asyncore.loop(timeout=0.1,
- count=500), name="ident")
+ count=500))
t.start()
try:
with socket.socket(self.family, socket.SOCK_STREAM) as s: