Use 'terminate' to clean up webserver subprocess

We already have TestProcess.terminate which does exactly the same
WebserverProcess.cleanup does.

See #3384
This commit is contained in:
Florian Bruhin 2017-12-12 09:33:34 +01:00
parent 5a97e79099
commit 6655793e6a

View File

@ -172,11 +172,6 @@ class WebserverProcess(testprocess.Process):
def _default_args(self): def _default_args(self):
return [str(self.port)] return [str(self.port)]
def cleanup(self):
"""Clean up and shut down the process."""
self.proc.terminate()
self.proc.waitForFinished()
@pytest.fixture(scope='session', autouse=True) @pytest.fixture(scope='session', autouse=True)
def server(qapp): def server(qapp):
@ -184,7 +179,7 @@ def server(qapp):
server = WebserverProcess('webserver_sub') server = WebserverProcess('webserver_sub')
server.start() server.start()
yield server yield server
server.cleanup() server.terminate()
@pytest.fixture(autouse=True) @pytest.fixture(autouse=True)
@ -208,4 +203,4 @@ def ssl_server(request, qapp):
server.start() server.start()
yield server yield server
server.after_test() server.after_test()
server.cleanup() server.terminate()