Uncomment chdir
I guess this was commented because the tempdir wasnt working
BUG=chromium:708293
TEST=Run tests
Change-Id: Ie7e7d82f54c81d72a19def4dd0f9a64063f8000a
Reviewed-on: https://chromium-review.googlesource.com/473490
Commit-Ready: Allen Li <ayatane@chromium.org>
Tested-by: Allen Li <ayatane@chromium.org>
Reviewed-by: Paul Hobbs <phobbs@google.com>
diff --git a/scripts/sysmon/git_metrics_unittest.py b/scripts/sysmon/git_metrics_unittest.py
index 3917fe9..4ee0e8b 100644
--- a/scripts/sysmon/git_metrics_unittest.py
+++ b/scripts/sysmon/git_metrics_unittest.py
@@ -26,10 +26,10 @@
def _InitRepo(self):
"""Initializes a repo in the temp directory."""
self.git_dir = os.path.join(self.tempdir, '.git')
- # with osutils.ChdirContext(self.tempdir):
- self.git_repo = git_metrics._GitRepo(self.git_dir)
- self.git_repo._check_output(['init'])
- self.git_repo._check_output(['commit', '--allow-empty', '-m', 'hi'])
+ with osutils.ChdirContext(self.tempdir):
+ self.git_repo = git_metrics._GitRepo(self.git_dir)
+ self.git_repo._check_output(['init'])
+ self.git_repo._check_output(['commit', '--allow-empty', '-m', 'hi'])
def testCollectGitHashTypesAreCorrect(self):
"""Tests that collecting the git hash doesn't have type conflicts."""