()
| 1262 | |
| 1263 | |
| 1264 | def 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 | |
| 1288 | async def _all_users(db): |
no test coverage detected