File tree Expand file tree Collapse file tree 2 files changed +6
-12
lines changed Expand file tree Collapse file tree 2 files changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -243,12 +243,9 @@ async def test_getattr(self, async_client):
243
243
assert "has no attribute '_does_not_exist'" in str (context .value )
244
244
245
245
async def test_iteration (self , async_client ):
246
- if _IS_SYNC or sys .version_info < (3 , 10 ):
247
- msg = "'AsyncMongoClient' object is not iterable"
248
- else :
249
- msg = "'AsyncMongoClient' object is not an async iterator"
246
+ msg = "'AsyncMongoClient' object is not iterable"
250
247
251
- with pytest .raises (TypeError , match = "'AsyncMongoClient' object is not iterable" ):
248
+ with pytest .raises (TypeError , match = msg ):
252
249
for _ in async_client :
253
250
break
254
251
@@ -261,7 +258,7 @@ async def test_iteration(self, async_client):
261
258
_ = await anext (async_client )
262
259
263
260
# 'next()' method fails
264
- with pytest .raises (TypeError , match = "'AsyncMongoClient' object is not iterable" ):
261
+ with pytest .raises (TypeError , match = msg ):
265
262
_ = await async_client .anext ()
266
263
267
264
# Do not implement typing.Iterable
Original file line number Diff line number Diff line change @@ -240,12 +240,9 @@ def test_getattr(self, client):
240
240
assert "has no attribute '_does_not_exist'" in str (context .value )
241
241
242
242
def test_iteration (self , client ):
243
- if _IS_SYNC or sys .version_info < (3 , 10 ):
244
- msg = "'MongoClient' object is not iterable"
245
- else :
246
- msg = "'MongoClient' object is not an async iterator"
243
+ msg = "'MongoClient' object is not iterable"
247
244
248
- with pytest .raises (TypeError , match = "'MongoClient' object is not iterable" ):
245
+ with pytest .raises (TypeError , match = msg ):
249
246
for _ in client :
250
247
break
251
248
@@ -258,7 +255,7 @@ def test_iteration(self, client):
258
255
_ = next (client )
259
256
260
257
# 'next()' method fails
261
- with pytest .raises (TypeError , match = "'MongoClient' object is not iterable" ):
258
+ with pytest .raises (TypeError , match = msg ):
262
259
_ = client .next ()
263
260
264
261
# Do not implement typing.Iterable
You can’t perform that action at this time.
0 commit comments