From a6c52f566acfbff5b0f37158c0d33adf05d250e5 Mon Sep 17 00:00:00 2001 From: Joanna Wang Date: Thu, 3 Nov 2022 16:51:19 -0400 Subject: Set tracing to always on and save to .repo/TRACE_FILE. - add `--trace_to_stderr` option so stderr will include trace outputs and any other errors that get sent to stderr - while TRACE_FILE will only include trace outputs piggy-backing on: https://gerrit-review.googlesource.com/c/git-repo/+/349154 Change-Id: I3895a84de4b2784f17fac4325521cd5e72e645e2 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/350114 Reviewed-by: LaMont Jones Tested-by: Joanna Wang --- tests/test_git_config.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests/test_git_config.py') diff --git a/tests/test_git_config.py b/tests/test_git_config.py index a4fad9ef..0df38430 100644 --- a/tests/test_git_config.py +++ b/tests/test_git_config.py @@ -19,6 +19,7 @@ import tempfile import unittest import git_config +import repo_trace def fixture(*paths): @@ -33,9 +34,16 @@ class GitConfigReadOnlyTests(unittest.TestCase): def setUp(self): """Create a GitConfig object using the test.gitconfig fixture. """ + + self.tempdirobj = tempfile.TemporaryDirectory(prefix='repo_tests') + repo_trace._TRACE_FILE = os.path.join(self.tempdirobj.name, 'TRACE_FILE_from_test') + config_fixture = fixture('test.gitconfig') self.config = git_config.GitConfig(config_fixture) + def tearDown(self): + self.tempdirobj.cleanup() + def test_GetString_with_empty_config_values(self): """ Test config entries with no value. @@ -109,9 +117,15 @@ class GitConfigReadWriteTests(unittest.TestCase): """Read/write tests of the GitConfig class.""" def setUp(self): + self.tempdirobj = tempfile.TemporaryDirectory(prefix='repo_tests') + repo_trace._TRACE_FILE = os.path.join(self.tempdirobj.name, 'TRACE_FILE_from_test') + self.tmpfile = tempfile.NamedTemporaryFile() self.config = self.get_config() + def tearDown(self): + self.tempdirobj.cleanup() + def get_config(self): """Get a new GitConfig instance.""" return git_config.GitConfig(self.tmpfile.name) -- cgit v1.2.3-54-g00ecf