# HG changeset patch # User David Schleimer # Date 1376526820 25200 # Node ID c8d0f59835713d5054b5e85eee917e41fb0f194e # Parent 661f4065bfbf448cac3e6d53662c8782c7561b10 tests: cd to tempdir during setUp Since we were running hg clone from the hgsubversion repo, we would often pick up config settings from hgsubversion/.hg/hgrc, including loading extensions. This caused tests to fail for me when they asserted that obsolete is disabled because I have evolve enabled in my hgsubversion checkout. This was probably decreasing the overall stability of the test suite as well, since it meant that clones were running with pretty much arbitrary configs settings. Interestingly, the setUp was already keeping a record of the cwd before creating the tempdir, and tearDown was already cd-ing back to that directory. diff --git a/tests/test_util.py b/tests/test_util.py --- a/tests/test_util.py +++ b/tests/test_util.py @@ -366,6 +366,7 @@ class TestBase(unittest.TestCase): self.oldwd = os.getcwd() self.tmpdir = tempfile.mkdtemp( 'svnwrap_test', dir=os.environ.get('HGSUBVERSION_TEST_TEMP', None)) + os.chdir(self.tmpdir) self.hgrc = os.path.join(self.tmpdir, '.hgrc') os.environ['HGRCPATH'] = self.hgrc scmutil._rcpath = None