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

Method wrap

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

Source from the content-addressed store, hash-verified

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