From 1d17cdade0aa8be68b39e79af50f52d273a9fbf2 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Mon, 18 Aug 2014 16:11:56 +1000 Subject: * ``FakePopen`` now works under a context manager itself. (Steve Kowalik, #1358085) --- lib/fixtures/tests/_fixtures/test_popen.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/fixtures/tests/_fixtures/test_popen.py') diff --git a/lib/fixtures/tests/_fixtures/test_popen.py b/lib/fixtures/tests/_fixtures/test_popen.py index dc9374c..8eb0174 100644 --- a/lib/fixtures/tests/_fixtures/test_popen.py +++ b/lib/fixtures/tests/_fixtures/test_popen.py @@ -72,6 +72,11 @@ class TestFakePopen(testtools.TestCase, TestWithFixtures): self.assertEqual(1, proc.wait()) self.assertEqual(1, proc.returncode) + def test_with_popen_custom(self): + fixture = self.useFixture(FakePopen()) + with subprocess.Popen(['ls -lh']) as proc: + self.assertEqual(None, proc.returncode) + class TestFakeProcess(testtools.TestCase): -- cgit v1.2.1