Mercurial > python-hglib
comparison tests/__init__.py @ 67:730c42743ba3
tests: cleanup on test finish so Windows doesn't complain about used files
- chdir out of the test dir before rmtree
- cache instances of hgclient and close them explicitly on tearDown before
rmtree
author | Idan Kamara <idankk86@gmail.com> |
---|---|
date | Mon, 05 Sep 2011 20:51:29 +0300 |
parents | eac8be119d81 |
children | bdc1650f216c |
comparison
equal
deleted
inserted
replaced
66:358fd5c84270 | 67:730c42743ba3 |
---|---|
16 os.environ["HGENCODINGMODE"] = "strict" | 16 os.environ["HGENCODINGMODE"] = "strict" |
17 tmpdir = tempfile.mkdtemp('', 'python-hglib.') | 17 tmpdir = tempfile.mkdtemp('', 'python-hglib.') |
18 os.environ["HGTMP"] = os.path.realpath(tmpdir) | 18 os.environ["HGTMP"] = os.path.realpath(tmpdir) |
19 | 19 |
20 def tearDown(self): | 20 def tearDown(self): |
21 os.chdir('..') | |
21 shutil.rmtree(os.environ["HGTMP"]) | 22 shutil.rmtree(os.environ["HGTMP"]) |