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

Method require_replica_set

test/__init__.py:555–557  ·  view source on GitHub ↗

Run a test only if the client is connected to a replica set.

(self, func: Any)

Source from the content-addressed store, hash-verified

553 )
554
555 def require_replica_set(self, func: Any) -> Any:
556 """Run a test only if the client is connected to a replica set."""
557 return self._require(lambda: self.is_rs, "Not connected to a replica set", func=func)
558
559 def require_secondaries_count(self, count):
560 """Run a test only if the client is connected to a replica set that has

Callers

nothing calls this directly

Calls 1

_requireMethod · 0.95

Tested by

no test coverage detected