diff --git a/test/asynchronous/test_srv_polling.py b/test/asynchronous/test_srv_polling.py index b40aa90cfa..3ba50e77a8 100644 --- a/test/asynchronous/test_srv_polling.py +++ b/test/asynchronous/test_srv_polling.py @@ -20,7 +20,6 @@ import time from test.utils_shared import FunctionCallRecorder from typing import Any -from unittest import skipIf sys.path[0:0] = [""] @@ -92,7 +91,6 @@ def __exit__(self, exc_type, exc_val, exc_tb): self.disable() -@skipIf(not _IS_SYNC and sys.platform == "win32", "PYTHON-5342 known issue on Windows") class TestSrvPolling(AsyncPyMongoTestCase): BASE_SRV_RESPONSE = [ ("localhost.test.build.10gen.cc", 27017), @@ -186,6 +184,9 @@ def dns_resolver_response(): ): await assertion_method(expected_response, client) + # Close the client early to avoid affecting the next scenario run. + await client.close() + async def test_addition(self): response = self.BASE_SRV_RESPONSE[:] response.append(("localhost.test.build.10gen.cc", 27019)) diff --git a/test/test_srv_polling.py b/test/test_srv_polling.py index 0d84d41241..971c3bad50 100644 --- a/test/test_srv_polling.py +++ b/test/test_srv_polling.py @@ -20,7 +20,6 @@ import time from test.utils_shared import FunctionCallRecorder from typing import Any -from unittest import skipIf sys.path[0:0] = [""] @@ -92,7 +91,6 @@ def __exit__(self, exc_type, exc_val, exc_tb): self.disable() -@skipIf(not _IS_SYNC and sys.platform == "win32", "PYTHON-5342 known issue on Windows") class TestSrvPolling(PyMongoTestCase): BASE_SRV_RESPONSE = [ ("localhost.test.build.10gen.cc", 27017), @@ -186,6 +184,9 @@ def dns_resolver_response(): ): assertion_method(expected_response, client) + # Close the client early to avoid affecting the next scenario run. + client.close() + def test_addition(self): response = self.BASE_SRV_RESPONSE[:] response.append(("localhost.test.build.10gen.cc", 27019))