Skip to content

Commit 6e45ee5

Browse files
committed
Require 4.2+ for tests
1 parent 27d3b9d commit 6e45ee5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/test_encryption.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3010,6 +3010,8 @@ class TestNoSessionsSupport(IntegrationTest):
30103010

30113011
@classmethod
30123012
@client_context.require_sessions
3013+
@unittest.skipIf(os.environ.get("TEST_CRYPT_SHARED"), "crypt_shared lib is installed")
3014+
@client_context.require_version_min(4, 2, -1)
30133015
def setUpClass(cls):
30143016
super().setUpClass()
30153017
start_mongocryptd(cls.MONGOCRYPTD_PORT)
@@ -3028,8 +3030,6 @@ def setUp(self) -> None:
30283030
hello = self.mongocryptd_client.db.command("hello")
30293031
self.assertNotIn("logicalSessionTimeoutMinutes", hello)
30303032

3031-
@client_context.require_sessions
3032-
@unittest.skipIf(os.environ.get("TEST_CRYPT_SHARED"), "crypt_shared lib is installed")
30333033
def test_implicit_session_ignored_when_unsupported(self):
30343034
self.listener.reset()
30353035
with self.assertRaises(OperationFailure):
@@ -3041,16 +3041,16 @@ def test_implicit_session_ignored_when_unsupported(self):
30413041
self.mongocryptd_client.db.test.insert_one({"x": 1})
30423042

30433043
self.assertNotIn("lsid", self.listener.started_events[1].command)
3044+
self.mongocryptd_client.close()
30443045

3045-
@client_context.require_sessions
3046-
@unittest.skipIf(os.environ.get("TEST_CRYPT_SHARED"), "crypt_shared lib is installed")
30473046
def test_explicit_session_errors_when_unsupported(self):
30483047
self.listener.reset()
30493048
with self.mongocryptd_client.start_session() as s:
30503049
with self.assertRaises(ConfigurationError):
30513050
self.mongocryptd_client.db.test.find_one(session=s)
30523051
with self.assertRaises(ConfigurationError):
30533052
self.mongocryptd_client.db.test.insert_one({"x": 1}, session=s)
3053+
self.mongocryptd_client.close()
30543054

30553055

30563056
if __name__ == "__main__":

0 commit comments

Comments
 (0)