From f866311d60f54499c3637309e3429780d8c8f218 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 15 May 2020 06:00:35 -0400 Subject: Add platform-specific code to override the home directory to honor bpo-36264. Fixes #2112. --- setuptools/tests/test_packageindex.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'setuptools') 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 -- cgit v1.2.3