test: don't rely on __del__ in test-devel-warnings.t
authorPierre-Yves David <pierre-yves.david@fb.com>
Tue, 05 Apr 2016 12:19:45 -0700
changeset 28822 b7782424dec8
parent 28821 d3369dc6c1d0
child 28823 c5565fc8848d
test: don't rely on __del__ in test-devel-warnings.t Whatever the future of __del__ in Mercurial is, that devel-warning test is not about testing the automatic transaction rollback and we should explicitly call release. This change make this tests pass with pypy, as pypy try less hard to call __del__ at program exit.
tests/test-devel-warnings.t
--- a/tests/test-devel-warnings.t	Tue Apr 05 20:01:23 2016 +0100
+++ b/tests/test-devel-warnings.t	Tue Apr 05 12:19:45 2016 -0700
@@ -11,6 +11,8 @@
   > @command('buggylocking', [], '')
   > def buggylocking(ui, repo):
   >     tr = repo.transaction('buggy')
+  >     # make sure we rollback the transaction as we don't want to rely on the__del__
+  >     tr.release()
   >     lo = repo.lock()
   >     wl = repo.wlock()
   >     wl.release()