aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/tests
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2020-08-08 17:01:41 -0400
committerJason R. Coombs <jaraco@jaraco.com>2020-08-08 18:48:01 -0400
commit47ae38fd6f233e6423404bfebfd24d3b98fb897c (patch)
tree6f9567ad8f43ee004a026772ae82ec15b0d016c3 /setuptools/tests
parent41deeb76fc88382f27b3d37cce75eda2c54cbc2a (diff)
downloadexternal_python_setuptools-47ae38fd6f233e6423404bfebfd24d3b98fb897c.tar.gz
external_python_setuptools-47ae38fd6f233e6423404bfebfd24d3b98fb897c.tar.bz2
external_python_setuptools-47ae38fd6f233e6423404bfebfd24d3b98fb897c.zip
On Windows, SYSTEMROOT must be supplied.
Diffstat (limited to 'setuptools/tests')
-rw-r--r--setuptools/tests/test_distutils_adoption.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/setuptools/tests/test_distutils_adoption.py b/setuptools/tests/test_distutils_adoption.py
index 476b0a9e..7f28a217 100644
--- a/setuptools/tests/test_distutils_adoption.py
+++ b/setuptools/tests/test_distutils_adoption.py
@@ -2,6 +2,7 @@ import os
import sys
import functools
import subprocess
+import platform
import pytest
import jaraco.envs
@@ -32,10 +33,12 @@ def popen_text(call):
if sys.version_info < (3, 7) else functools.partial(call, text=True)
-def find_distutils(venv, imports='distutils', **kwargs):
+def find_distutils(venv, imports='distutils', env=None, **kwargs):
py_cmd = 'import {imports}; print(distutils.__file__)'.format(**locals())
cmd = ['python', '-c', py_cmd]
- return popen_text(venv.run)(cmd, **kwargs)
+ if platform.system() == 'Windows':
+ env['SYSTEMROOT'] = os.environ['SYSTEMROOT']
+ return popen_text(venv.run)(cmd, env=env, **kwargs)
def test_distutils_stdlib(venv):