File tree Expand file tree Collapse file tree 4 files changed +24
-24
lines changed Expand file tree Collapse file tree 4 files changed +24
-24
lines changed Original file line number Diff line number Diff line change 32
32
import warnings
33
33
from asyncio import iscoroutinefunction
34
34
35
+ from pymongo .errors import AutoReconnect
35
36
from pymongo .synchronous .uri_parser import parse_uri
36
37
37
38
try :
@@ -1237,12 +1238,17 @@ def teardown():
1237
1238
c = client_context .client
1238
1239
if c :
1239
1240
if not client_context .is_data_lake :
1240
- c .drop_database ("pymongo-pooling-tests" )
1241
- c .drop_database ("pymongo_test" )
1242
- c .drop_database ("pymongo_test1" )
1243
- c .drop_database ("pymongo_test2" )
1244
- c .drop_database ("pymongo_test_mike" )
1245
- c .drop_database ("pymongo_test_bernie" )
1241
+ try :
1242
+ c .drop_database ("pymongo-pooling-tests" )
1243
+ c .drop_database ("pymongo_test" )
1244
+ c .drop_database ("pymongo_test1" )
1245
+ c .drop_database ("pymongo_test2" )
1246
+ c .drop_database ("pymongo_test_mike" )
1247
+ c .drop_database ("pymongo_test_bernie" )
1248
+ except AutoReconnect :
1249
+ # PYTHON-4982
1250
+ if sys .implementation .name .lower () != "pypy" :
1251
+ raise
1246
1252
c .close ()
1247
1253
print_running_clients ()
1248
1254
Original file line number Diff line number Diff line change 33
33
from asyncio import iscoroutinefunction
34
34
35
35
from pymongo .asynchronous .uri_parser import parse_uri
36
+ from pymongo .errors import AutoReconnect
36
37
37
38
try :
38
39
import ipaddress
@@ -1253,12 +1254,17 @@ async def async_teardown():
1253
1254
c = async_client_context .client
1254
1255
if c :
1255
1256
if not async_client_context .is_data_lake :
1256
- await c .drop_database ("pymongo-pooling-tests" )
1257
- await c .drop_database ("pymongo_test" )
1258
- await c .drop_database ("pymongo_test1" )
1259
- await c .drop_database ("pymongo_test2" )
1260
- await c .drop_database ("pymongo_test_mike" )
1261
- await c .drop_database ("pymongo_test_bernie" )
1257
+ try :
1258
+ await c .drop_database ("pymongo-pooling-tests" )
1259
+ await c .drop_database ("pymongo_test" )
1260
+ await c .drop_database ("pymongo_test1" )
1261
+ await c .drop_database ("pymongo_test2" )
1262
+ await c .drop_database ("pymongo_test_mike" )
1263
+ await c .drop_database ("pymongo_test_bernie" )
1264
+ except AutoReconnect :
1265
+ # PYTHON-4982
1266
+ if sys .implementation .name .lower () != "pypy" :
1267
+ raise
1262
1268
await c .close ()
1263
1269
print_running_clients ()
1264
1270
Original file line number Diff line number Diff line change @@ -3482,8 +3482,6 @@ class TestNoSessionsSupport(AsyncEncryptionIntegrationTest):
3482
3482
MONGOCRYPTD_PORT = 27020
3483
3483
3484
3484
async def asyncSetUp (self ) -> None :
3485
- if sys .implementation .name .lower () == "pypy" :
3486
- return
3487
3485
await super ().asyncSetUp ()
3488
3486
start_mongocryptd (self .MONGOCRYPTD_PORT )
3489
3487
@@ -3496,8 +3494,6 @@ async def asyncSetUp(self) -> None:
3496
3494
self .assertNotIn ("logicalSessionTimeoutMinutes" , hello )
3497
3495
3498
3496
async def test_implicit_session_ignored_when_unsupported (self ):
3499
- if sys .implementation .name .lower () == "pypy" :
3500
- raise self .skipTest ("PYTHON-4982 Skipping test on pypy" )
3501
3497
self .listener .reset ()
3502
3498
with self .assertRaises (OperationFailure ):
3503
3499
await self .mongocryptd_client .db .test .find_one ()
@@ -3512,8 +3508,6 @@ async def test_implicit_session_ignored_when_unsupported(self):
3512
3508
await self .mongocryptd_client .close ()
3513
3509
3514
3510
async def test_explicit_session_errors_when_unsupported (self ):
3515
- if sys .implementation .name .lower () == "pypy" :
3516
- raise self .skipTest ("PYTHON-4982 Skipping test on pypy" )
3517
3511
self .listener .reset ()
3518
3512
async with self .mongocryptd_client .start_session () as s :
3519
3513
with self .assertRaisesRegex (
Original file line number Diff line number Diff line change @@ -3464,8 +3464,6 @@ class TestNoSessionsSupport(EncryptionIntegrationTest):
3464
3464
MONGOCRYPTD_PORT = 27020
3465
3465
3466
3466
def setUp (self ) -> None :
3467
- if sys .implementation .name .lower () == "pypy" :
3468
- return
3469
3467
super ().setUp ()
3470
3468
start_mongocryptd (self .MONGOCRYPTD_PORT )
3471
3469
@@ -3478,8 +3476,6 @@ def setUp(self) -> None:
3478
3476
self .assertNotIn ("logicalSessionTimeoutMinutes" , hello )
3479
3477
3480
3478
def test_implicit_session_ignored_when_unsupported (self ):
3481
- if sys .implementation .name .lower () == "pypy" :
3482
- raise self .skipTest ("PYTHON-4982 Skipping test on pypy" )
3483
3479
self .listener .reset ()
3484
3480
with self .assertRaises (OperationFailure ):
3485
3481
self .mongocryptd_client .db .test .find_one ()
@@ -3494,8 +3490,6 @@ def test_implicit_session_ignored_when_unsupported(self):
3494
3490
self .mongocryptd_client .close ()
3495
3491
3496
3492
def test_explicit_session_errors_when_unsupported (self ):
3497
- if sys .implementation .name .lower () == "pypy" :
3498
- raise self .skipTest ("PYTHON-4982 Skipping test on pypy" )
3499
3493
self .listener .reset ()
3500
3494
with self .mongocryptd_client .start_session () as s :
3501
3495
with self .assertRaisesRegex (
You can’t perform that action at this time.
0 commit comments