Skip to content

Commit

Permalink
Use temporary home directory for test_env_file_home_directory
Browse files Browse the repository at this point in the history
Issue: #463
  • Loading branch information
CyberTailor committed Nov 3, 2024
1 parent 00d1aac commit cf4aa52
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -1116,9 +1116,13 @@ class Settings(BaseSettings):


@pytest.fixture
def home_tmp():
def home_tmp(tmp_path, env):
env.set('HOME', str(tmp_path))
env.set('USERPROFILE', str(tmp_path))
env.set('HOMEPATH', str(tmp_path))

tmp_filename = f'{uuid.uuid4()}.env'
home_tmp_path = Path.home() / tmp_filename
home_tmp_path = tmp_path / tmp_filename
yield home_tmp_path, tmp_filename
home_tmp_path.unlink()

Expand Down

0 comments on commit cf4aa52

Please sign in to comment.