[PATCH] run-tests.py: reset cwd after each test

Mads Kiilerich mads at kiilerich.com
Sun Feb 7 19:57:25 CST 2010


# HG changeset patch
# User Mads Kiilerich <mads at kiilerich.com>
# Date 1265594241 -3600
# Node ID bc86633b086c08ea75c1c2e5533181396cfdb64e
# Parent  98e7028a41bc2ec1de154834d9f20c48d5476b74
run-tests.py: reset cwd after each test

runone had (and has) several ways to exit without changing cwd back.
That could cause -k runs to fail.

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -639,7 +639,6 @@
 
     killdaemons()
 
-    os.chdir(TESTDIR)
     if not options.keep_tmpdir:
         shutil.rmtree(tmpd, True)
     if skipped:
@@ -803,6 +802,7 @@
                     continue
 
             ret = runone(options, test, skips, fails)
+            os.chdir(TESTDIR)
             if ret is None:
                 skipped += 1
             elif not ret:


More information about the Mercurial-devel mailing list