from contextlib import closing, ExitStack
from http.server import HTTPServer, SimpleHTTPRequestHandler
from importlib import import_module
from contextlib import closing, ExitStack
from http.server import HTTPServer, SimpleHTTPRequestHandler
from importlib import import_module
from multiprocessing import Process
from os import kill, unlink
from signal import SIGINT
from multiprocessing import Process
from os import kill, unlink
from signal import SIGINT
_, self.tmpfilebase = mkstemp()
self.conf = ConfigParser()
self.conf["common"] = {
_, self.tmpfilebase = mkstemp()
self.conf = ConfigParser()
self.conf["common"] = {
}
self.conf["collector"] = {
"port": str(freeports[0]),
}
self.conf["collector"] = {
"port": str(freeports[0]),
p = Process(target=cls.runserver, args=(self.conf,), kwargs=kwargs)
p.start()
self.children.append((srvname, p))
p = Process(target=cls.runserver, args=(self.conf,), kwargs=kwargs)
p.start()
self.children.append((srvname, p))
def tearDown(self) -> None:
for srvname, p in self.children:
if p.pid is not None:
kill(p.pid, SIGINT)
p.join()
def tearDown(self) -> None:
for srvname, p in self.children:
if p.pid is not None:
kill(p.pid, SIGINT)
p.join()