Skip to content

Commit cf4aa52

Browse files
committed
Use temporary home directory for test_env_file_home_directory
Issue: #463
1 parent 00d1aac commit cf4aa52

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/test_settings.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,9 +1116,13 @@ class Settings(BaseSettings):
11161116

11171117

11181118
@pytest.fixture
1119-
def home_tmp():
1119+
def home_tmp(tmp_path, env):
1120+
env.set('HOME', str(tmp_path))
1121+
env.set('USERPROFILE', str(tmp_path))
1122+
env.set('HOMEPATH', str(tmp_path))
1123+
11201124
tmp_filename = f'{uuid.uuid4()}.env'
1121-
home_tmp_path = Path.home() / tmp_filename
1125+
home_tmp_path = tmp_path / tmp_filename
11221126
yield home_tmp_path, tmp_filename
11231127
home_tmp_path.unlink()
11241128

0 commit comments

Comments
 (0)