Skip to content

Commit 4940379

Browse files
committed
Avoid ResourceWarnings in TestPooling.
1 parent 2bc6d93 commit 4940379

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/test_pooling.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ def run_mongo_thread(self):
123123

124124
self.state = 'sock'
125125

126+
def __del__(self):
127+
if self.sock:
128+
self.sock.close()
129+
126130

127131
def run_cases(client, cases):
128132
threads = []

0 commit comments

Comments
 (0)