MCPcopy Create free account
hub / github.com/mongodb/mongo-python-driver / run_scenario

Method run_scenario

test/unified_format.py:1453–1473  ·  view source on GitHub ↗
(self, spec, uri=None)

Source from the content-addressed store, hash-verified

1451 self.assertListEqual(sorted_expected_documents, actual_documents)
1452
1453 def run_scenario(self, spec, uri=None):
1454 # Handle flaky tests.
1455 flaky_tests = [
1456 ("PYTHON-5170", ".*test_discovery_and_monitoring.*"),
1457 ("PYTHON-5174", ".*Driver_extends_timeout_while_streaming"),
1458 ("PYTHON-5315", ".*TestSrvPolling.test_recover_from_initially_.*"),
1459 ("PYTHON-4987", ".*UnknownTransactionCommitResult_labels_to_connection_errors"),
1460 ("PYTHON-3689", ".*TestProse.test_load_balancing"),
1461 ("PYTHON-3522", ".*csot.*"),
1462 ]
1463 for reason, flaky_test in flaky_tests:
1464 if re.match(flaky_test.lower(), self.id().lower()) is not None:
1465 func_name = self.id()
1466 options = dict(reason=reason, reset_func=self.setUp, func_name=func_name)
1467 if "csot" in func_name.lower():
1468 options["max_runs"] = 3
1469 options["affects_cpython_linux"] = True
1470 decorator = flaky(**options)
1471 decorator(self._run_scenario)(spec, uri)
1472 return
1473 self._run_scenario(spec, uri)
1474
1475 def _run_scenario(self, spec, uri=None):
1476 # maybe skip test manually

Callers 1

test_caseMethod · 0.45

Calls 4

_run_scenarioMethod · 0.95
flakyFunction · 0.90
idMethod · 0.80
decoratorFunction · 0.70

Tested by 1

test_caseMethod · 0.36