def lazy_client_trial(reset, target, test, get_client):
    collection = client_context.client.pymongo_test.test

    with frequent_thread_switches():
        for i in range(NTRIALS):
            reset(collection)
            lazy_client = get_client()
            lazy_collection = lazy_client.pymongo_test.test
            run_threads(lazy_collection, target)
            test(lazy_collection)
Test concurrent operations on a lazily-connecting client.
dataset/ETHPy150Open mongodb/mongo-python-driver/test/utils.py/lazy_client_trial