]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
test_fork_error: Fix incorrect test mock
authorAngus Lees <gus@inodes.org>
Fri, 15 May 2015 07:50:33 +0000 (17:50 +1000)
committerAngus Lees <gus@inodes.org>
Tue, 26 May 2015 00:11:52 +0000 (10:11 +1000)
The previous os.fork mock returned a *function* that returned an OSError
object.  Oops.

Change-Id: I6e5dff930cf5614f7061efdfd8429963703cc214

neutron/tests/unit/agent/linux/test_daemon.py

index b4bb355e1a9fba8ec4975a48975de47d9a6c95bb..4c01b6dbf8841da8f4eb56e1492c93584a329a7c 100644 (file)
@@ -235,7 +235,7 @@ class TestDaemon(base.BaseTestCase):
         self.assertIsNone(d._fork())
 
     def test_fork_error(self):
-        self.os.fork.side_effect = lambda: OSError(1)
+        self.os.fork.side_effect = OSError(1)
         with mock.patch.object(daemon.sys, 'stderr'):
             with testtools.ExpectedException(SystemExit):
                 d = daemon.Daemon('pidfile', 'stdin')