Skip to content

PYTHON-4996 - Ensure all async integration tests call their parent asyncSetup method #2023

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions test/asynchronous/test_client_bulk_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ async def test_raw_bson_not_inflated(self):
# https://github.com/mongodb/specifications/tree/master/source/crud/tests
class TestClientBulkWriteCRUD(AsyncIntegrationTest):
async def asyncSetUp(self):
await super().asyncSetUp()
self.max_write_batch_size = await async_client_context.max_write_batch_size
self.max_bson_object_size = await async_client_context.max_bson_size
self.max_message_size_bytes = await async_client_context.max_message_size_bytes
Expand Down Expand Up @@ -652,6 +653,7 @@ class TestClientBulkWriteCSOT(AsyncIntegrationTest):
async def asyncSetUp(self):
if os.environ.get("SKIP_CSOT_TESTS", ""):
raise unittest.SkipTest("SKIP_CSOT_TESTS is set, skipping...")
await super().asyncSetUp()
self.max_write_batch_size = await async_client_context.max_write_batch_size
self.max_bson_object_size = await async_client_context.max_bson_size
self.max_message_size_bytes = await async_client_context.max_message_size_bytes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class TestAsyncConnectionsSurvivePrimaryStepDown(AsyncIntegrationTest):

@async_client_context.require_replica_set
async def asyncSetUp(self):
await super().asyncSetUp()
self.listener = CMAPListener()
self.client = await self.async_rs_or_single_client(
event_listeners=[self.listener], retryWrites=False, heartbeatFrequencyMS=500
Expand Down
2 changes: 2 additions & 0 deletions test/test_client_bulk_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ def test_raw_bson_not_inflated(self):
# https://github.com/mongodb/specifications/tree/master/source/crud/tests
class TestClientBulkWriteCRUD(IntegrationTest):
def setUp(self):
super().setUp()
self.max_write_batch_size = client_context.max_write_batch_size
self.max_bson_object_size = client_context.max_bson_size
self.max_message_size_bytes = client_context.max_message_size_bytes
Expand Down Expand Up @@ -648,6 +649,7 @@ class TestClientBulkWriteCSOT(IntegrationTest):
def setUp(self):
if os.environ.get("SKIP_CSOT_TESTS", ""):
raise unittest.SkipTest("SKIP_CSOT_TESTS is set, skipping...")
super().setUp()
self.max_write_batch_size = client_context.max_write_batch_size
self.max_bson_object_size = client_context.max_bson_size
self.max_message_size_bytes = client_context.max_message_size_bytes
Expand Down
1 change: 1 addition & 0 deletions test/test_connections_survive_primary_stepdown_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class TestConnectionsSurvivePrimaryStepDown(IntegrationTest):

@client_context.require_replica_set
def setUp(self):
super().setUp()
self.listener = CMAPListener()
self.client = self.rs_or_single_client(
event_listeners=[self.listener], retryWrites=False, heartbeatFrequencyMS=500
Expand Down
1 change: 1 addition & 0 deletions test/test_gridfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,7 @@ def setUp(self):
super().setUp()

@classmethod
@client_context.require_connection
def tearDownClass(cls):
client_context.client.drop_database("gfsreplica")

Expand Down
1 change: 1 addition & 0 deletions test/test_gridfs_bucket.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ def setUp(self):
super().setUp()

@classmethod
@client_context.require_connection
def tearDownClass(cls):
client_context.client.drop_database("gfsbucketreplica")

Expand Down
Loading