diff options
| author | Mike Frysinger <vapier@google.com> | 2022-12-08 08:55:54 -0500 |
|---|---|---|
| committer | Mike Frysinger <vapier@google.com> | 2022-12-08 22:22:39 +0000 |
| commit | e81528649236ec9fb5983191767a96dc30acff54 (patch) | |
| tree | 74b288fe316d673595a8eaf56e5270d4d41b224f /tests/test_project.py | |
| parent | 0ab6b1168811586b62d8d1c26bad118b0a4b3807 (diff) | |
| download | git-repo-e81528649236ec9fb5983191767a96dc30acff54.tar.gz | |
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 <jojwang@google.com>
Tested-by: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'tests/test_project.py')
| -rw-r--r-- | tests/test_project.py | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/tests/test_project.py b/tests/test_project.py index 7ab44984..66c05f6a 100644 --- a/tests/test_project.py +++ b/tests/test_project.py | |||
| @@ -27,7 +27,6 @@ import git_command | |||
| 27 | import git_config | 27 | import git_config |
| 28 | import platform_utils | 28 | import platform_utils |
| 29 | import project | 29 | import project |
| 30 | import repo_trace | ||
| 31 | 30 | ||
| 32 | 31 | ||
| 33 | @contextlib.contextmanager | 32 | @contextlib.contextmanager |
| @@ -66,13 +65,6 @@ class FakeProject(object): | |||
| 66 | class ReviewableBranchTests(unittest.TestCase): | 65 | class ReviewableBranchTests(unittest.TestCase): |
| 67 | """Check ReviewableBranch behavior.""" | 66 | """Check ReviewableBranch behavior.""" |
| 68 | 67 | ||
| 69 | def setUp(self): | ||
| 70 | self.tempdirobj = tempfile.TemporaryDirectory(prefix='repo_tests') | ||
| 71 | repo_trace._TRACE_FILE = os.path.join(self.tempdirobj.name, 'TRACE_FILE_from_test') | ||
| 72 | |||
| 73 | def tearDown(self): | ||
| 74 | self.tempdirobj.cleanup() | ||
| 75 | |||
| 76 | def test_smoke(self): | 68 | def test_smoke(self): |
| 77 | """A quick run through everything.""" | 69 | """A quick run through everything.""" |
| 78 | with TempGitTree() as tempdir: | 70 | with TempGitTree() as tempdir: |
| @@ -418,8 +410,6 @@ class ManifestPropertiesFetchedCorrectly(unittest.TestCase): | |||
| 418 | """Ensure properties are fetched properly.""" | 410 | """Ensure properties are fetched properly.""" |
| 419 | 411 | ||
| 420 | def setUpManifest(self, tempdir): | 412 | def setUpManifest(self, tempdir): |
| 421 | repo_trace._TRACE_FILE = os.path.join(tempdir, 'TRACE_FILE_from_test') | ||
| 422 | |||
| 423 | repodir = os.path.join(tempdir, '.repo') | 413 | repodir = os.path.join(tempdir, '.repo') |
| 424 | manifest_dir = os.path.join(repodir, 'manifests') | 414 | manifest_dir = os.path.join(repodir, 'manifests') |
| 425 | manifest_file = os.path.join( | 415 | manifest_file = os.path.join( |
