#NEWLINE# def assert_cmd_failure( cmd , **kwargs ) : #NEWLINE# #INDENT# '\n    Asserts that running a command returns non-zero.\n\n    returns: stdout\n    ' #NEWLINE# print ( '>>>' , cmd , kwargs ) #NEWLINE# ( r , out , err ) = run ( r , withexitstatus = True , ** kwargs ) #NEWLINE# print ( '<<<' , str ( out ) ) #NEWLINE# assert ( 0 != r ) , ( 'cmd succeeded, but it should fail: %s result=%u\noutput=\n%s' % ( cmd , r , out ) ) #NEWLINE# return out