#NEWLINE# def main( ) : #NEWLINE# #INDENT# if ( Popen ( [ 'redis-cli' , 'info' ] , stdout = PIPE ) . wait ( ) != 0 ) : #NEWLINE# #INDENT# raise RuntimeError ( 'Redis server is not running.' ) #NEWLINE# #UNINDENT# pipe = ( 'rg' if ( Popen ( [ 'which' , 'rg' ] , stdout = PIPE ) . wait ( ) == 0 ) else 'cat' ) #NEWLINE# module = ( 'discover' if ( platform . python_version ( ) < '2.7' ) else 'unittest discover' ) #NEWLINE# p = Popen ( ( '/usr/bin/env python -m %s -v -s tests %s' % ( module , ' ' . join ( sys . argv [ 1 : ] ) ) ) , shell = True , stdout = PIPE , stderr = STDOUT ) #NEWLINE# exit_code = p . wait ( ) #NEWLINE# ( out , _ ) = p . communicate ( ) #NEWLINE# p2 = Popen ( ( "egrep -v '^test_' | %s" % pipe ) , shell = True , stdin = PIPE , stdout = PIPE , stderr = STDOUT ) #NEWLINE# ( out , _ ) = p2 . communicate ( input = out ) #NEWLINE# print ( out . decode ( ) ) #NEWLINE# return exit_code