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

Function print_running_clients

test/__init__.py:1248–1269  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1246
1247
1248def print_running_clients():
1249 from pymongo.synchronous.topology import Topology
1250
1251 processed = set()
1252 # Avoid false positives on the main test client.
1253 # XXX: Can be removed after PYTHON-1634 or PYTHON-1896.
1254 c = client_context.client
1255 if c:
1256 processed.add(c._topology._topology_id)
1257 # Call collect to manually cleanup any would-be gc'd clients to avoid
1258 # false positives.
1259 gc.collect()
1260 for obj in gc.get_objects():
1261 try:
1262 if isinstance(obj, Topology):
1263 # Avoid printing the same Topology multiple times.
1264 if obj._topology_id in processed:
1265 continue
1266 print_running_topology(obj)
1267 processed.add(obj._topology_id)
1268 except ReferenceError:
1269 pass
1270
1271
1272def _all_users(db):

Callers 1

teardownFunction · 0.70

Calls 2

print_running_topologyFunction · 0.90
addMethod · 0.80

Tested by

no test coverage detected