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

Method setUp

test/unified_format.py:538–564  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

536 cls.knobs.disable()
537
538 def setUp(self):
539 # super call creates internal client cls.client
540 super().setUp()
541 # process file-level runOnRequirements
542 run_on_spec = self.TEST_SPEC.get("runOnRequirements", [])
543 if not self.should_run_on(run_on_spec):
544 raise unittest.SkipTest(f"{self.__class__.__name__} runOnRequirements not satisfied")
545
546 # add any special-casing for skipping tests here
547
548 # Handle mongos_clients for transactions tests.
549 self.mongos_clients = []
550 if client_context.supports_transactions() and not client_context.load_balancer:
551 for address in client_context.mongoses:
552 self.mongos_clients.append(self.single_client("{}:{}".format(*address)))
553
554 # process schemaVersion
555 # note: we check major schema version during class generation
556 version = Version.from_string(self.TEST_SPEC["schemaVersion"])
557 self.assertLessEqual(
558 version,
559 self.SCHEMA_VERSION,
560 f"expected schema version {self.SCHEMA_VERSION} or lower, got {version}",
561 )
562
563 # initialize internals
564 self.match_evaluator = MatchEvaluatorUtil(self)
565
566 def maybe_skip_test(self, spec):
567 # add any special-casing for skipping tests here

Callers

nothing calls this directly

Calls 6

should_run_onMethod · 0.95
MatchEvaluatorUtilClass · 0.90
single_clientMethod · 0.80
from_stringMethod · 0.80
getMethod · 0.45
supports_transactionsMethod · 0.45

Tested by

no test coverage detected