def find_empty_redis_database():
    for dbnum in range(4, 17):
        testconn = StrictRedis(db=dbnum)
        empty = len(testconn.keys('*')) == 0
        if empty:
            return testconn
    assert False, 'No empty Redis database found to run tests in.'
Tries to connect to a random Redis database (starting from 4), and
dataset/ETHPy150Open ui/rq-scheduler/tests/__init__.py/find_empty_redis_database