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

Function print_running_clients

test/asynchronous/__init__.py:1264–1285  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1262
1263
1264def print_running_clients():
1265 from pymongo.asynchronous.topology import Topology
1266
1267 processed = set()
1268 # Avoid false positives on the main test client.
1269 # XXX: Can be removed after PYTHON-1634 or PYTHON-1896.
1270 c = async_client_context.client
1271 if c:
1272 processed.add(c._topology._topology_id)
1273 # Call collect to manually cleanup any would-be gc'd clients to avoid
1274 # false positives.
1275 gc.collect()
1276 for obj in gc.get_objects():
1277 try:
1278 if isinstance(obj, Topology):
1279 # Avoid printing the same Topology multiple times.
1280 if obj._topology_id in processed:
1281 continue
1282 print_running_topology(obj)
1283 processed.add(obj._topology_id)
1284 except ReferenceError:
1285 pass
1286
1287
1288async def _all_users(db):

Callers 1

async_teardownFunction · 0.70

Calls 2

print_running_topologyFunction · 0.90
addMethod · 0.80

Tested by

no test coverage detected