From e81528649236ec9fb5983191767a96dc30acff54 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 8 Dec 2022 08:55:54 -0500 Subject: tests: clean up repo_trace._TRACE_FILE patching Patch this automatically for all tests rather than duplicating the boilerplate in diff testcases. Change-Id: I391d5c859974cda3d5680d34ede2ce6e9e925838 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/354358 Reviewed-by: Joanna Wang Tested-by: Mike Frysinger --- tests/test_git_config.py | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'tests/test_git_config.py') diff --git a/tests/test_git_config.py b/tests/test_git_config.py index 63c148f3..3b0aa8b4 100644 --- a/tests/test_git_config.py +++ b/tests/test_git_config.py @@ -19,7 +19,6 @@ import tempfile import unittest import git_config -import repo_trace def fixture(*paths): @@ -34,16 +33,9 @@ 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. @@ -117,15 +109,9 @@ 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