def with_kill_srv(f):
 @wraps(f)
 def wrapper(self, *args):
  pidfile = args[(-1)]
  try:
   return f(self, *args)
  finally:
   _kill_srv(pidfile)
 return wrapper

def with_kill_srv ( f ) : @ wraps ( f ) def wrapper ( self , * args ) : pidfile = args [ ( - 1 ) ] try : return f ( self , * args ) finally : _kill_srv ( pidfile ) return wrapper
helper to decorate tests which receive in the last argument tmpdir to pass to kill_srv to be used in tandem with @with_tmpdir .