From e107819085256d3563329b0895c5eebf68a8a952 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Wed, 5 Jul 2023 14:48:46 -0700 Subject: [PATCH] chdir inside test --- tests/test_main.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test_main.py b/tests/test_main.py index dfff719ac..8aa7ebd91 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -34,6 +34,9 @@ class TestMain(TestCase): self.assertTrue(os.path.exists("foo.txt")) def test_main_with_empty_git_dir_new_file(self): + tempdir = tempfile.mkdtemp() + os.chdir(tempdir) + subprocess.run(["git", "init"]) subprocess.run(["git", "config", "user.email", "dummy@example.com"]) subprocess.run(["git", "config", "user.name", "Dummy User"])