diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2022-04-29 20:08:55 -0400 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2022-04-29 20:08:55 -0400 |
| commit | 414ff105b44ffdfd64f98851bd747fd04295a824 (patch) | |
| tree | 28609e541272053e1ae65a39ba59785e072a5c5b | |
| parent | 57903582af9c1eb7dec150f25fea3bc196932a0a (diff) | |
| download | python-setuptools-git-414ff105b44ffdfd64f98851bd747fd04295a824.tar.gz | |
Rely on jaraco.envs for environment creation.
| -rw-r--r-- | distutils/tests/test_sysconfig.py | 16 | ||||
| -rw-r--r-- | tox.ini | 1 |
2 files changed, 10 insertions, 7 deletions
diff --git a/distutils/tests/test_sysconfig.py b/distutils/tests/test_sysconfig.py index 70b7ad19..1c88cc85 100644 --- a/distutils/tests/test_sysconfig.py +++ b/distutils/tests/test_sysconfig.py @@ -7,6 +7,9 @@ import sys import textwrap import unittest +import jaraco.envs + +import distutils from distutils import sysconfig from distutils.ccompiler import get_default_compiler from distutils.unixccompiler import UnixCCompiler @@ -320,17 +323,16 @@ class SysconfigTestCase(support.EnvironGuard, unittest.TestCase): 'Need sys.executable to be in a source tree') def test_win_build_venv_from_source_tree(self): """Ensure distutils.sysconfig detects venvs from source tree builds.""" + env = jaraco.envs.VEnv() + env.create_opts = env.clean_opts + env.root = TESTFN + env.ensure_env() cmd = [ - str(sys.executable), "-m", "venv", - rf".\{TESTFN}", "--without-pip", - ] - subprocess.check_output(cmd) - distutils_path = os.path.dirname(os.path.dirname(sysconfig.__file__)) - cmd = [ - rf".\{TESTFN}\Scripts\python.exe", + env.exe(), "-c", "import distutils.sysconfig; print(distutils.sysconfig.python_build)" ] + distutils_path = os.path.dirname(os.path.dirname(distutils.__file__)) out = subprocess.check_output(cmd, env={**os.environ, "PYTHONPATH": distutils_path}) assert out == "True" @@ -1,6 +1,7 @@ [testenv] deps = pytest + jaraco.envs>=2.4 commands = pytest {posargs} setenv = |
