Skip to content

Commit f45b35a

Browse files
authored
PYTHON-4996 - Ensure all async integration tests call their parent asyncSetup method (#2023)
1 parent a9e61f6 commit f45b35a

6 files changed

+8
-0
lines changed

test/asynchronous/test_client_bulk_write.py

+2
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ async def test_raw_bson_not_inflated(self):
102102
# https://github.com/mongodb/specifications/tree/master/source/crud/tests
103103
class TestClientBulkWriteCRUD(AsyncIntegrationTest):
104104
async def asyncSetUp(self):
105+
await super().asyncSetUp()
105106
self.max_write_batch_size = await async_client_context.max_write_batch_size
106107
self.max_bson_object_size = await async_client_context.max_bson_size
107108
self.max_message_size_bytes = await async_client_context.max_message_size_bytes
@@ -652,6 +653,7 @@ class TestClientBulkWriteCSOT(AsyncIntegrationTest):
652653
async def asyncSetUp(self):
653654
if os.environ.get("SKIP_CSOT_TESTS", ""):
654655
raise unittest.SkipTest("SKIP_CSOT_TESTS is set, skipping...")
656+
await super().asyncSetUp()
655657
self.max_write_batch_size = await async_client_context.max_write_batch_size
656658
self.max_bson_object_size = await async_client_context.max_bson_size
657659
self.max_message_size_bytes = await async_client_context.max_message_size_bytes

test/asynchronous/test_connections_survive_primary_stepdown_spec.py

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class TestAsyncConnectionsSurvivePrimaryStepDown(AsyncIntegrationTest):
4646

4747
@async_client_context.require_replica_set
4848
async def asyncSetUp(self):
49+
await super().asyncSetUp()
4950
self.listener = CMAPListener()
5051
self.client = await self.async_rs_or_single_client(
5152
event_listeners=[self.listener], retryWrites=False, heartbeatFrequencyMS=500

test/test_client_bulk_write.py

+2
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ def test_raw_bson_not_inflated(self):
102102
# https://github.com/mongodb/specifications/tree/master/source/crud/tests
103103
class TestClientBulkWriteCRUD(IntegrationTest):
104104
def setUp(self):
105+
super().setUp()
105106
self.max_write_batch_size = client_context.max_write_batch_size
106107
self.max_bson_object_size = client_context.max_bson_size
107108
self.max_message_size_bytes = client_context.max_message_size_bytes
@@ -648,6 +649,7 @@ class TestClientBulkWriteCSOT(IntegrationTest):
648649
def setUp(self):
649650
if os.environ.get("SKIP_CSOT_TESTS", ""):
650651
raise unittest.SkipTest("SKIP_CSOT_TESTS is set, skipping...")
652+
super().setUp()
651653
self.max_write_batch_size = client_context.max_write_batch_size
652654
self.max_bson_object_size = client_context.max_bson_size
653655
self.max_message_size_bytes = client_context.max_message_size_bytes

test/test_connections_survive_primary_stepdown_spec.py

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class TestConnectionsSurvivePrimaryStepDown(IntegrationTest):
4646

4747
@client_context.require_replica_set
4848
def setUp(self):
49+
super().setUp()
4950
self.listener = CMAPListener()
5051
self.client = self.rs_or_single_client(
5152
event_listeners=[self.listener], retryWrites=False, heartbeatFrequencyMS=500

test/test_gridfs.py

+1
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,7 @@ def setUp(self):
511511
super().setUp()
512512

513513
@classmethod
514+
@client_context.require_connection
514515
def tearDownClass(cls):
515516
client_context.client.drop_database("gfsreplica")
516517

test/test_gridfs_bucket.py

+1
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,7 @@ def setUp(self):
481481
super().setUp()
482482

483483
@classmethod
484+
@client_context.require_connection
484485
def tearDownClass(cls):
485486
client_context.client.drop_database("gfsbucketreplica")
486487

0 commit comments

Comments
 (0)