aider: Passed temp_dir as the cwd to subprocess in test_main_with_empty_git_dir_new_file.

# Context:
USER: pass temp_dir as the cwd to subprocess in test_main_with_empty_git_dir_new_file
ASSISTANT: Here's the change to pass `temp_dir` as the `cwd` to `subprocess` in the `test_main_with_empty_git_dir_new_file` function:

```python
tests/test_main.py
<<<<<<< ORIGINAL
            subprocess.run(["git", "init"])
=======
            subprocess.run(["git", "init"], cwd=temp_dir)
>>>>>>> UPDATED
```
This commit is contained in:
Paul Gauthier 2023-05-11 17:52:34 -07:00
parent 8a60462167
commit 3b0c5132f2

View file

@ -29,7 +29,7 @@ class TestMain(TestCase):
def test_main_with_empty_git_dir_new_file(self):
with tempfile.TemporaryDirectory() as temp_dir:
os.chdir(temp_dir)
subprocess.run(["git", "init"])
subprocess.run(["git", "init"], cwd=temp_dir)
with open(os.devnull, "r") as dev_null:
save_stdin = sys.stdin
sys.stdin = dev_null