def find_empty_redis_database():
 for dbnum in range(4, 17):
  testconn = StrictRedis(db=dbnum)
  empty = (len(testconn.keys(u'*')) == 0)
  if empty:
   return testconn
 assert False, u'No empty Redis database found to run tests in.'

def find_empty_redis_database ( ) : for dbnum in range ( 4 , 17 ) : testconn = StrictRedis ( db = dbnum ) empty = ( len ( testconn . keys ( u'*' ) ) == 0 ) if empty : return testconn assert False , u'No empty Redis database found to run tests in.'
tries to connect to a random redis database .