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

Method wrap

test/__init__.py:445–466  ·  view source on GitHub ↗
(*args, **kwargs)

Source from the content-addressed store, hash-verified

443
444 @wraps(f)
445 def wrap(*args, **kwargs):
446 self.init()
447 # Always raise SkipTest if we can't connect to MongoDB
448 if not self.connected:
449 pair = self.pair
450 raise SkipTest(f"Cannot connect to MongoDB on {pair}")
451 if iscoroutinefunction(condition):
452 if condition():
453 if wraps_async:
454 return f(*args, **kwargs)
455 else:
456 return f(*args, **kwargs)
457 elif condition():
458 if wraps_async:
459 return f(*args, **kwargs)
460 else:
461 return f(*args, **kwargs)
462 if "self.pair" in msg:
463 new_msg = msg.replace("self.pair", self.pair)
464 else:
465 new_msg = msg
466 raise SkipTest(new_msg)
467
468 return wrap
469

Callers

nothing calls this directly

Calls 1

initMethod · 0.95

Tested by

no test coverage detected