D957: test-push-race: use 'ui.atexit' instead of python's 'atexit'.
singhsrb (Saurabh Singh)
phabricator at mercurial-scm.org
Thu Oct 5 20:43:35 UTC 2017
singhsrb created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
'atexit' is sometimes not called (like when a process is killed by the
SIGTERM signal). Therefore, this commit replaces it with 'ui.atexit' which is
always called. This also makes the test compatible with chg.
TEST PLAN
Ran the test 'test-push-race.t' with and without the '--chg' option.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D957
AFFECTED FILES
tests/test-push-race.t
CHANGE DETAILS
diff --git a/tests/test-push-race.t b/tests/test-push-race.t
--- a/tests/test-push-race.t
+++ b/tests/test-push-race.t
@@ -15,7 +15,6 @@
> Client with the extensions will create a file when ready and get stuck until
> a file is created."""
>
- > import atexit
> import errno
> import os
> import time
@@ -51,7 +50,7 @@
> except OSError as exc:
> if exc.errno != errno.ENOENT:
> raise
- > atexit.register(delete)
+ > ui.atexit(delete)
> return orig(pushop)
>
> def uisetup(ui):
To: singhsrb, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list