Merge lp:~stevenk/python-fixtures/fakeprocess-kill into lp:~python-fixtures/python-fixtures/trunk

Proposed by Steve Kowalik
Status: Merged
Merged at revision: 78
Proposed branch: lp:~stevenk/python-fixtures/fakeprocess-kill
Merge into: lp:~python-fixtures/python-fixtures/trunk
Prerequisite: lp:~stevenk/python-fixtures/fakeopen-with
Diff against target: 37 lines (+8/-0)
3 files modified
NEWS (+1/-0)
lib/fixtures/_fixtures/popen.py (+3/-0)
lib/fixtures/tests/_fixtures/test_popen.py (+4/-0)
To merge this branch: bzr merge lp:~stevenk/python-fixtures/fakeprocess-kill
Reviewer Review Type Date Requested Status
python-fixtures committers Pending
Review via email: mp+231296@code.launchpad.net

Description of the change

Python 3.3+ may call subprocess.kill() in some cases, so FakeProcess should support that interface.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'NEWS'
2--- NEWS 2014-08-19 04:44:18 +0000
3+++ NEWS 2014-08-19 04:44:18 +0000
4@@ -11,6 +11,7 @@
5
6 * ``FakePopen`` now supports being called under a context manager (IE: with).
7 (Steve Kowalik)
8+* ``FakeProcess`` now supports kill(). (Steve Kowalik)
9
10 0.3.14
11 ~~~~~~
12
13=== modified file 'lib/fixtures/_fixtures/popen.py'
14--- lib/fixtures/_fixtures/popen.py 2014-08-19 04:44:18 +0000
15+++ lib/fixtures/_fixtures/popen.py 2014-08-19 04:44:18 +0000
16@@ -54,6 +54,9 @@
17 def __exit__(self, exc_type, exc_value, traceback):
18 self.wait()
19
20+ def kill(self):
21+ pass
22+
23 def wait(self):
24 if self.returncode is None:
25 self.communicate()
26
27=== modified file 'lib/fixtures/tests/_fixtures/test_popen.py'
28--- lib/fixtures/tests/_fixtures/test_popen.py 2014-08-19 04:44:18 +0000
29+++ lib/fixtures/tests/_fixtures/test_popen.py 2014-08-19 04:44:18 +0000
30@@ -94,3 +94,7 @@
31 proc = FakeProcess({}, {'stdout': BytesIO(_b('foo'))})
32 self.assertEqual((_b('foo'), ''), proc.communicate())
33 self.assertEqual(0, proc.returncode)
34+
35+ def test_kill(self):
36+ proc = FakeProcess({}, {})
37+ self.assertIs(None, proc.kill())

Subscribers

People subscribed via source and target branches