mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-20 04:14:59 +00:00
Merge pull request #1196 from akaihola/isolated-tests
Use fake home directory to prevent `~/.aider.conf.yml` from affecting the test suite
This commit is contained in:
commit
0dcbc09761
1 changed files with 4 additions and 0 deletions
|
@ -26,10 +26,14 @@ class TestMain(TestCase):
|
|||
self.tempdir_obj = IgnorantTemporaryDirectory()
|
||||
self.tempdir = self.tempdir_obj.name
|
||||
os.chdir(self.tempdir)
|
||||
# Fake home directory prevents tests from using the real ~/.aider.conf.yml file:
|
||||
self.homedir_obj = IgnorantTemporaryDirectory()
|
||||
os.environ["HOME"] = self.homedir_obj.name
|
||||
|
||||
def tearDown(self):
|
||||
os.chdir(self.original_cwd)
|
||||
self.tempdir_obj.cleanup()
|
||||
self.homedir_obj.cleanup()
|
||||
os.environ.clear()
|
||||
os.environ.update(self.original_env)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue