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 <lamontjones@google.com>
Tested-by: Joanna Wang <jojwang@google.com>
diff --git a/tests/test_project.py b/tests/test_project.py
index acd44cc..5c600be 100644
--- a/tests/test_project.py
+++ b/tests/test_project.py
@@ -26,6 +26,7 @@
import git_config
import platform_utils
import project
+import repo_trace
@contextlib.contextmanager
@@ -64,6 +65,13 @@
class ReviewableBranchTests(unittest.TestCase):
"""Check ReviewableBranch behavior."""
+ def setUp(self):
+ self.tempdirobj = tempfile.TemporaryDirectory(prefix='repo_tests')
+ repo_trace._TRACE_FILE = os.path.join(self.tempdirobj.name, 'TRACE_FILE_from_test')
+
+ def tearDown(self):
+ self.tempdirobj.cleanup()
+
def test_smoke(self):
"""A quick run through everything."""
with TempGitTree() as tempdir: