diff options
author | Robert Collins <robertc@robertcollins.net> | 2014-08-22 15:01:57 +1200 |
---|---|---|
committer | Robert Collins <robertc@robertcollins.net> | 2014-08-22 15:01:57 +1200 |
commit | 273c55e6455cc0e484f4260ca93535aed635fb44 (patch) | |
tree | c41f824c9bac58250dfe5188ee6db11d1aa0217c | |
parent | 8dbefec6563cb4d073fc5aa68d4ed760f68863e1 (diff) | |
parent | bb2f668cab2e80bdd89b3fee0befc1683c3f956e (diff) | |
download | fixtures-273c55e6455cc0e484f4260ca93535aed635fb44.tar.gz |
* ``FakeProcess`` wait() now supports arguments added in Python 3.
(Steve Kowalik)
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | lib/fixtures/_fixtures/popen.py | 2 | ||||
-rw-r--r-- | lib/fixtures/tests/_fixtures/test_popen.py | 4 |
3 files changed, 8 insertions, 1 deletions
@@ -14,6 +14,9 @@ CHANGES * ``FakeProcess`` now supports kill(). (Steve Kowalik) +* ``FakeProcess`` wait() now supports arguments added in Python 3. + (Steve Kowalik) + * ``MonkeyPatch`` now preserves ``staticmethod`` functions. (Dan Kenigsberg) diff --git a/lib/fixtures/_fixtures/popen.py b/lib/fixtures/_fixtures/popen.py index 67f20e3..728e980 100644 --- a/lib/fixtures/_fixtures/popen.py +++ b/lib/fixtures/_fixtures/popen.py @@ -57,7 +57,7 @@ class FakeProcess(object): def kill(self): pass - def wait(self): + def wait(self, timeout=None, endtime=None): if self.returncode is None: self.communicate() return self.returncode diff --git a/lib/fixtures/tests/_fixtures/test_popen.py b/lib/fixtures/tests/_fixtures/test_popen.py index 6d47291..98b762f 100644 --- a/lib/fixtures/tests/_fixtures/test_popen.py +++ b/lib/fixtures/tests/_fixtures/test_popen.py @@ -98,3 +98,7 @@ class TestFakeProcess(testtools.TestCase): def test_kill(self): proc = FakeProcess({}, {}) self.assertIs(None, proc.kill()) + + def test_wait_with_timeout_and_endtime(self): + proc = FakeProcess({}, {}) + self.assertEqual(0 , proc.wait(timeout=4, endtime=7)) |