(self)
| 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 |
nothing calls this directly
no test coverage detected