changeset 27168:8a829fc84bb3

test-fncache: ensure lock doesn't look held to __del__ This was showing a DeprecationWarning on Python 2.6.
author Augie Fackler <augie@google.com>
date Tue, 01 Dec 2015 14:44:08 -0500
parents 3fe8cb40c9c5
children dd214130a4f6
files tests/test-fncache.t
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-fncache.t	Wed Nov 11 20:07:15 2015 -0500
+++ b/tests/test-fncache.t	Tue Dec 01 14:44:08 2015 -0500
@@ -209,8 +209,10 @@
   > 
   > def lockexception(orig, vfs, lockname, wait, releasefn, *args, **kwargs):
   >     def releasewrap():
+  >         l.held = False # ensure __del__ is a noop
   >         raise error.Abort("forced lock failure")
-  >     return orig(vfs, lockname, wait, releasewrap, *args, **kwargs)
+  >     l = orig(vfs, lockname, wait, releasewrap, *args, **kwargs)
+  >     return l
   > 
   > def reposetup(ui, repo):
   >     wrapfunction(repo, '_lock', lockexception)
@@ -225,7 +227,6 @@
   $ touch y
   $ hg ci -qAm y
   abort: forced lock failure
-  Exception mercurial.error.Abort: Abort('forced lock failure',) in <bound method lock.__del__ of <mercurial.lock.lock object at *>> ignored (glob)
   [255]
   $ cat .hg/store/fncache
   data/y.i