PYTHON-903 - Don't *require* a network error in auth test.

This commit is contained in:
A. Jesse Jiryu Davis 2015-04-23 22:08:23 -04:00
parent 4c39f1a99f
commit 8c5e547274

View File

@ -1022,9 +1022,12 @@ class TestReplicaSetClientAuth(TestReplicaSetClientBase, TestRequestMixin):
socket_info.sock.close()
# In __check_auth, the client authenticates its socket with the
# new credential, but gets a socket.error. Should be reraised as
# AutoReconnect.
self.assertRaises(AutoReconnect, c.test.collection.find_one)
# new credential, but gets a socket.error. Reraised as AutoReconnect,
# unless periodic monitoring or Pool._check prevent the error.
try:
c.test.collection.find_one()
except AutoReconnect:
pass
# No semaphore leak, the pool is allowed to make a new socket.
c.test.collection.find_one()