def check_usage(module, force_help=False):
 args = (('--help',) if force_help else ())
 with ArgvSetter(args) as out:
  try:
   module.run()
  except SystemExit:
   pass
  assert_true(('Usage: ' in out.stdout.getvalue()))

def check_usage ( module , force_help = False ) : args = ( ( '--help' , ) if force_help else ( ) ) with ArgvSetter ( args ) as out : try : module . run ( ) except SystemExit : pass assert_true ( ( 'Usage: ' in out . stdout . getvalue ( ) ) )
helper to ensure we print usage .