tests/test-lock.py
changeset 26384 ad6e56d01c30
parent 26382 b673e89affc9
child 26385 fb1a424e8bff
--- a/tests/test-lock.py	Thu Sep 24 21:26:37 2015 -0700
+++ b/tests/test-lock.py	Thu Sep 24 20:22:59 2015 -0700
@@ -12,6 +12,15 @@
 
 testlockname = 'testlock'
 
+class lockwrapper(lock.lock):
+    def __init__(self, pidoffset, *args, **kwargs):
+        # lock.lock.__init__() calls lock(), so the pidoffset assignment needs
+        # to be earlier
+        self._pidoffset = pidoffset
+        super(lockwrapper, self).__init__(*args, **kwargs)
+    def _getpid(self):
+        return os.getpid() + self._pidoffset
+
 class teststate(object):
     def __init__(self, testcase, dir):
         self._testcase = testcase