changeset 1081:c8d0f5983571

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.
author David Schleimer <dschleimer@fb.com>
date Wed, 14 Aug 2013 17:33:40 -0700
parents 661f4065bfbf
children 362e359607c1
files tests/test_util.py
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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