summaryrefslogtreecommitdiff
path: root/testing/tests/conftest.py
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2017-03-01 21:02:41 -0300
committerVictor Shyba <victor1984@riseup.net>2017-03-02 18:54:32 -0300
commit32c950d16e7bea55bb7af3f4650af857be9027e0 (patch)
tree1c4796f2061ef734589fd1227f8f2be1d5dc2a84 /testing/tests/conftest.py
parent6deadf8adeb8c6b4a98e2d69e2bf3b1447a6b4ca (diff)
[test] improve twistd startup and termination
- use subprocess.check_call() to ensure any errors during twistd startup will properly show up on test reports. - use SIGTERM instead of SIGKILL to gracefully terminate twistd.
Diffstat (limited to 'testing/tests/conftest.py')
-rw-r--r--testing/tests/conftest.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/testing/tests/conftest.py b/testing/tests/conftest.py
index 49cc35f6..c077828f 100644
--- a/testing/tests/conftest.py
+++ b/testing/tests/conftest.py
@@ -6,7 +6,7 @@ import signal
import time
from hashlib import sha512
-from subprocess import call
+from subprocess import check_call
from urlparse import urljoin
from uuid import uuid4
@@ -98,7 +98,7 @@ class SoledadServer(object):
def start(self):
self._create_conf_file()
# start the server
- call([
+ check_call([
'twistd',
'--logfile=%s' % self._logfile,
'--pidfile=%s' % self._pidfile,
@@ -118,7 +118,7 @@ class SoledadServer(object):
def stop(self):
pid = get_pid(self._pidfile)
- os.kill(pid, signal.SIGKILL)
+ os.kill(pid, signal.SIGTERM)
@pytest.fixture(scope='module')