()
| 1246 | |
| 1247 | |
| 1248 | def 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 | |
| 1272 | def _all_users(db): |
no test coverage detected