aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/tests/test_packageindex.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2020-05-15 06:00:35 -0400
committerJason R. Coombs <jaraco@jaraco.com>2020-05-15 06:00:35 -0400
commitf866311d60f54499c3637309e3429780d8c8f218 (patch)
tree6111c07bf4a7f6e5d5243fbe85675f253c914b6c /setuptools/tests/test_packageindex.py
parent2187d0c770de3a93f9a6cdcf53d9a217167dcc83 (diff)
downloadexternal_python_setuptools-f866311d60f54499c3637309e3429780d8c8f218.tar.gz
external_python_setuptools-f866311d60f54499c3637309e3429780d8c8f218.tar.bz2
external_python_setuptools-f866311d60f54499c3637309e3429780d8c8f218.zip
Add platform-specific code to override the home directory to honor bpo-36264. Fixes #2112.
Diffstat (limited to 'setuptools/tests/test_packageindex.py')
-rw-r--r--setuptools/tests/test_packageindex.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/setuptools/tests/test_packageindex.py b/setuptools/tests/test_packageindex.py
index 7b7815ab..29aace13 100644
--- a/setuptools/tests/test_packageindex.py
+++ b/setuptools/tests/test_packageindex.py
@@ -3,6 +3,7 @@ from __future__ import absolute_import
import sys
import os
import distutils.errors
+import platform
from setuptools.extern import six
from setuptools.extern.six.moves import urllib, http_client
@@ -285,7 +286,13 @@ class TestContentCheckers:
@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