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

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

Description of the change

Python 3 added two optional arguments to subprocess.wait(), timeout and endtime, so FakeProcess's wait() should support them.

To post a comment you must log in.
78. By Steve Kowalik

  * ``FakeProcess`` wait() now supports arguments added in Python 3.
      (Steve Kowalik)

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-22 02:46:10 +0000
3+++ NEWS 2014-08-22 02:53:13 +0000
4@@ -13,6 +13,8 @@
5 (Steve Kowalik)
6
7 * ``FakeProcess`` now supports kill(). (Steve Kowalik)
8+* ``FakeProcess`` wait() now supports arguments added in Python 3.
9+ (Steve Kowalik)
10
11 * ``MonkeyPatch`` now preserves ``staticmethod`` functions.
12 (Dan Kenigsberg)
13
14=== modified file 'lib/fixtures/_fixtures/popen.py'
15--- lib/fixtures/_fixtures/popen.py 2014-08-19 04:40:33 +0000
16+++ lib/fixtures/_fixtures/popen.py 2014-08-22 02:53:13 +0000
17@@ -57,7 +57,7 @@
18 def kill(self):
19 pass
20
21- def wait(self):
22+ def wait(self, timeout=None, endtime=None):
23 if self.returncode is None:
24 self.communicate()
25 return self.returncode
26
27=== modified file 'lib/fixtures/tests/_fixtures/test_popen.py'
28--- lib/fixtures/tests/_fixtures/test_popen.py 2014-08-19 04:40:33 +0000
29+++ lib/fixtures/tests/_fixtures/test_popen.py 2014-08-22 02:53:13 +0000
30@@ -98,3 +98,7 @@
31 def test_kill(self):
32 proc = FakeProcess({}, {})
33 self.assertIs(None, proc.kill())
34+
35+ def test_wait_with_timeout_and_endtime(self):
36+ proc = FakeProcess({}, {})
37+ self.assertEqual(0 , proc.wait(timeout=4, endtime=7))

Subscribers

People subscribed via source and target branches