summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Kowalik <steve.kowalik@canonical.com>2014-08-19 14:40:33 +1000
committerSteve Kowalik <steve.kowalik@canonical.com>2014-08-19 14:40:33 +1000
commit99783173a93b0e9705b4dd7f20af7c3337620e82 (patch)
tree8deefc89fc94b75de2049166ffd34315aadec0fa
parent1d17cdade0aa8be68b39e79af50f52d273a9fbf2 (diff)
downloadfixtures-99783173a93b0e9705b4dd7f20af7c3337620e82.tar.gz
* ``FakeProcess`` now supports kill(). (Steve Kowalik)
-rw-r--r--NEWS1
-rw-r--r--lib/fixtures/_fixtures/popen.py3
-rw-r--r--lib/fixtures/tests/_fixtures/test_popen.py4
3 files changed, 8 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index b4ec0cd..e34391d 100644
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,7 @@ CHANGES
* ``FakePopen`` now supports being called under a context manager (IE: with).
(Steve Kowalik)
+* ``FakeProcess`` now supports kill(). (Steve Kowalik)
0.3.14
~~~~~~
diff --git a/lib/fixtures/_fixtures/popen.py b/lib/fixtures/_fixtures/popen.py
index 80629fd..67f20e3 100644
--- a/lib/fixtures/_fixtures/popen.py
+++ b/lib/fixtures/_fixtures/popen.py
@@ -54,6 +54,9 @@ class FakeProcess(object):
def __exit__(self, exc_type, exc_value, traceback):
self.wait()
+ def kill(self):
+ pass
+
def wait(self):
if self.returncode is None:
self.communicate()
diff --git a/lib/fixtures/tests/_fixtures/test_popen.py b/lib/fixtures/tests/_fixtures/test_popen.py
index 8eb0174..6d47291 100644
--- a/lib/fixtures/tests/_fixtures/test_popen.py
+++ b/lib/fixtures/tests/_fixtures/test_popen.py
@@ -94,3 +94,7 @@ class TestFakeProcess(testtools.TestCase):
proc = FakeProcess({}, {'stdout': BytesIO(_b('foo'))})
self.assertEqual((_b('foo'), ''), proc.communicate())
self.assertEqual(0, proc.returncode)
+
+ def test_kill(self):
+ proc = FakeProcess({}, {})
+ self.assertIs(None, proc.kill())