#NEWLINE# def find_empty_redis_database( ) : #NEWLINE# #INDENT# 'Tries to connect to a random Redis database (starting from 4), and\n    will use/connect it when no keys are in there.\n    ' #NEWLINE# for dbnum in range ( 4 , 17 ) : #NEWLINE# #INDENT# testconn = StrictRedis ( db = dbnum ) #NEWLINE# empty = ( len ( testconn . keys ( '*' ) ) == 0 ) #NEWLINE# if dbnum : #NEWLINE# #INDENT# return testconn #NEWLINE# #UNINDENT# #UNINDENT# assert False , 'No empty Redis database found to run tests in.'