diff options
author | drebs <drebs@leap.se> | 2017-03-01 21:02:41 -0300 |
---|---|---|
committer | Victor Shyba <victor1984@riseup.net> | 2017-03-02 18:54:32 -0300 |
commit | 32c950d16e7bea55bb7af3f4650af857be9027e0 (patch) | |
tree | 1c4796f2061ef734589fd1227f8f2be1d5dc2a84 | |
parent | 6deadf8adeb8c6b4a98e2d69e2bf3b1447a6b4ca (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.
-rw-r--r-- | testing/tests/conftest.py | 6 |
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') |