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

Method maybe_skip_test

test/unified_format.py:566–646  ·  view source on GitHub ↗
(self, spec)

Source from the content-addressed store, hash-verified

564 self.match_evaluator = MatchEvaluatorUtil(self)
565
566 def maybe_skip_test(self, spec):
567 # add any special-casing for skipping tests here
568 class_name = self.__class__.__name__.lower()
569 description = spec["description"].lower()
570
571 if "client side error in command starting transaction" in description:
572 self.skipTest("Implement PYTHON-1894")
573 if "type=symbol" in description:
574 self.skipTest("PyMongo does not support the symbol type")
575 if "timeoutms applied to entire download" in description:
576 self.skipTest("PyMongo's open_download_stream does not cap the stream's lifetime")
577 if any(
578 x in description
579 for x in [
580 "first insertone is never committed",
581 "second updateone is never committed",
582 "third updateone is never committed",
583 ]
584 ):
585 self.skipTest("Implement PYTHON-4597")
586
587 if "csot" in class_name:
588 # Skip tests that are too slow to run on a given platform.
589 slow_macos = [
590 "operation fails after two consecutive socket timeouts.*",
591 "operation succeeds after one socket timeout.*",
592 "Non-tailable cursor lifetime remaining timeoutMS applied to getMore if timeoutMode is unset",
593 ]
594 slow_win32 = [
595 *slow_macos,
596 "maxTimeMS value in the command is less than timeoutMS",
597 "timeoutMS applies to whole operation.*",
598 ]
599 slow_pypy = [
600 "timeoutMS applies to whole operation.*",
601 ]
602 if "CI" in os.environ and sys.platform == "win32" and "gridfs" in class_name:
603 self.skipTest("PYTHON-3522 CSOT GridFS test runs too slow on Windows")
604 if "CI" in os.environ and sys.platform == "win32":
605 for pat in slow_win32:
606 if re.match(pat.lower(), description):
607 self.skipTest("PYTHON-3522 CSOT test runs too slow on Windows")
608 if "CI" in os.environ and sys.platform == "darwin":
609 for pat in slow_macos:
610 if re.match(pat.lower(), description):
611 self.skipTest("PYTHON-3522 CSOT test runs too slow on MacOS")
612 if "CI" in os.environ and sys.implementation.name.lower() == "pypy":
613 for pat in slow_pypy:
614 if re.match(pat.lower(), description):
615 self.skipTest("PYTHON-3522 CSOT test runs too slow on PyPy")
616 if "change" in description or "change" in class_name:
617 self.skipTest("CSOT not implemented for watch()")
618 if "cursors" in class_name:
619 self.skipTest("CSOT not implemented for cursors")
620 if (
621 "tailable" in class_name
622 or "tailable" in description
623 and "non-tailable" not in description

Callers 1

_run_scenarioMethod · 0.95

Calls 1

getMethod · 0.45

Tested by

no test coverage detected