MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / test_use_after_close

Method test_use_after_close

test/test_encryption.py:381–388  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

379 self._test_auto_encrypt(opts)
380
381 def test_use_after_close(self):
382 opts = AutoEncryptionOpts(KMS_PROVIDERS, "keyvault.datakeys")
383 client = self.rs_or_single_client(auto_encryption_opts=opts)
384
385 client.admin.command("ping")
386 client.close()
387 with self.assertRaisesRegex(InvalidOperation, "Cannot use MongoClient after close"):
388 client.admin.command("ping")
389
390 @unittest.skipIf(
391 not hasattr(os, "register_at_fork"),

Callers

nothing calls this directly

Calls 4

AutoEncryptionOptsClass · 0.90
rs_or_single_clientMethod · 0.80
commandMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected