CP review
This commit is contained in:
parent
260c8298c6
commit
284dfa28bb
@ -29,7 +29,6 @@ from pymongo import AsyncMongoClient, message, timeout
|
||||
from pymongo.errors import AutoReconnect, ConnectionFailure, DuplicateKeyError
|
||||
from pymongo.hello import HelloCompat
|
||||
from pymongo.lock import _async_create_lock
|
||||
from pymongo.read_preferences import ReadPreference
|
||||
|
||||
sys.path[0:0] = [""]
|
||||
|
||||
|
||||
@ -48,6 +48,7 @@ from pymongo.errors import (
|
||||
AutoReconnect,
|
||||
ConnectionFailure,
|
||||
NotPrimaryError,
|
||||
PyMongoError,
|
||||
ServerSelectionTimeoutError,
|
||||
WriteConcernError,
|
||||
)
|
||||
@ -775,9 +776,7 @@ class TestErrorPropagationAfterEncounteringMultipleErrors(AsyncIntegrationTest):
|
||||
|
||||
# Attempt an insertOne operation on any record for any database and collection.
|
||||
# Expect the insertOne to fail with a server error.
|
||||
from pymongo.errors import OperationFailure
|
||||
|
||||
with self.assertRaises(Exception) as exc:
|
||||
with self.assertRaises(PyMongoError) as exc:
|
||||
await client.test.test.insert_one({})
|
||||
|
||||
# Assert that the error code of the server error is 91.
|
||||
|
||||
@ -705,7 +705,7 @@ class TestTransactionsConvenientAPI(AsyncTransactionsBase):
|
||||
async with self.client.start_session() as s:
|
||||
await s.with_transaction(callback)
|
||||
end = time.monotonic()
|
||||
self.assertLess(abs(end - start - (no_backoff_time + 2.2)), 1) # sum of 5 backoffs is 2.2
|
||||
self.assertLess(abs(end - start - (no_backoff_time + 2.2)), 1) # sum of 13 backoffs is 2.2
|
||||
|
||||
|
||||
class TestOptionsInsideTransactionProse(AsyncTransactionsBase):
|
||||
|
||||
@ -29,7 +29,6 @@ from pymongo import MongoClient, message, timeout
|
||||
from pymongo.errors import AutoReconnect, ConnectionFailure, DuplicateKeyError
|
||||
from pymongo.hello import HelloCompat
|
||||
from pymongo.lock import _create_lock
|
||||
from pymongo.read_preferences import ReadPreference
|
||||
|
||||
sys.path[0:0] = [""]
|
||||
|
||||
|
||||
@ -48,6 +48,7 @@ from pymongo.errors import (
|
||||
AutoReconnect,
|
||||
ConnectionFailure,
|
||||
NotPrimaryError,
|
||||
PyMongoError,
|
||||
ServerSelectionTimeoutError,
|
||||
WriteConcernError,
|
||||
)
|
||||
@ -771,9 +772,7 @@ class TestErrorPropagationAfterEncounteringMultipleErrors(IntegrationTest):
|
||||
|
||||
# Attempt an insertOne operation on any record for any database and collection.
|
||||
# Expect the insertOne to fail with a server error.
|
||||
from pymongo.errors import OperationFailure
|
||||
|
||||
with self.assertRaises(Exception) as exc:
|
||||
with self.assertRaises(PyMongoError) as exc:
|
||||
client.test.test.insert_one({})
|
||||
|
||||
# Assert that the error code of the server error is 91.
|
||||
|
||||
@ -693,7 +693,7 @@ class TestTransactionsConvenientAPI(TransactionsBase):
|
||||
with self.client.start_session() as s:
|
||||
s.with_transaction(callback)
|
||||
end = time.monotonic()
|
||||
self.assertLess(abs(end - start - (no_backoff_time + 2.2)), 1) # sum of 5 backoffs is 2.2
|
||||
self.assertLess(abs(end - start - (no_backoff_time + 2.2)), 1) # sum of 13 backoffs is 2.2
|
||||
|
||||
|
||||
class TestOptionsInsideTransactionProse(TransactionsBase):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user