def run_threads(collection, target):
    threads = []
    for i in range(NTHREADS):
        bound_target = partial(target, collection, i)
        threads.append(threading.Thread(target=bound_target))

    for t in threads:
        t.start()

    for t in threads:
        t.join(30)
        assert not t.isAlive()
Test Model base filtered views
dataset/ETHPy150Open mongodb/mongo-python-driver/test/utils.py/run_threads--crossover with--dataset/ETHPy150Open dpgaspar/Flask-AppBuilder/flask_appbuilder/tests/test_mongoengine.py/FlaskTestCase.test_model_base_filter