Skip to content

Commit

Permalink
Add platform-specific code to override the home directory to honor bp…
Browse files Browse the repository at this point in the history
…o-36264. Fixes #2112.
  • Loading branch information
jaraco committed May 15, 2020
1 parent 2187d0c commit f866311
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion setuptools/tests/test_packageindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import sys
import os
import distutils.errors
import platform

from setuptools.extern import six
from setuptools.extern.six.moves import urllib, http_client
Expand Down Expand Up @@ -285,7 +286,13 @@ def test_report(self):

@pytest.fixture
def temp_home(tmpdir, monkeypatch):
monkeypatch.setitem(os.environ, 'HOME', str(tmpdir))
key = (
'USERPROFILE'
if platform.system() == 'Windows' and sys.version_info > (3, 8) else
'HOME'
)

monkeypatch.setitem(os.environ, key, str(tmpdir))
return tmpdir


Expand Down

0 comments on commit f866311

Please sign in to comment.