def tearDownClass(cls): super(UnmanagedTorTest, cls).tearDownClass() try: for datadir in DATA_DIRS.itervalues(): pidfile = join(datadir, "pid") if exists(pidfile): pid = int(fu.read_file(pidfile)) fu.terminate_process(pid) log.debug("TEST: killed Tor {}.".format(basename(datadir))) fu.removedir(datadir) except Exception as exc: log.exception("Exception raised tearing down class {}: {}".format( cls.__name__, exc))
def terminate_process_and_log(self, pid, msg=None): fu.terminate_process(pid) if msg: log.debug(msg)