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

Function assertion_context

test/utils_shared.py:609–614  ·  view source on GitHub ↗

A context manager that adds info to an assertion failure.

(msg)

Source from the content-addressed store, hash-verified

607
608@contextlib.contextmanager
609def assertion_context(msg):
610 """A context manager that adds info to an assertion failure."""
611 try:
612 yield
613 except AssertionError as exc:
614 raise AssertionError(f"{msg}: {exc}")
615
616
617def parse_spec_options(opts):

Callers 2

run_scenarioFunction · 0.90
run_scenarioFunction · 0.90

Calls

no outgoing calls

Tested by 2

run_scenarioFunction · 0.72
run_scenarioFunction · 0.72