47 lines
1.8 KiB
Diff
47 lines
1.8 KiB
Diff
From 34d859b152e9b56808b6fb4dac252691ea0c42a8 Mon Sep 17 00:00:00 2001
|
|
From: Naveen M K <naveen521kk@gmail.com>
|
|
Date: Wed, 8 Nov 2023 19:44:22 +0530
|
|
Subject: [PATCH 103/N] mingw_smoketests: add a test to check if sysconfig
|
|
returns correct values for `LIBDIR`
|
|
|
|
---
|
|
mingw_smoketests.py | 18 ++++++++++++++++++
|
|
1 file changed, 18 insertions(+)
|
|
|
|
diff --git a/mingw_smoketests.py b/mingw_smoketests.py
|
|
index ca1f652..4f81c68 100644
|
|
--- a/mingw_smoketests.py
|
|
+++ b/mingw_smoketests.py
|
|
@@ -218,6 +218,9 @@ class Tests(unittest.TestCase):
|
|
import sysconfig
|
|
import platform
|
|
import importlib.machinery
|
|
+ import tempfile
|
|
+ import venv
|
|
+ import subprocess
|
|
self.assertEqual(sys.implementation.name, "cpython")
|
|
self.assertEqual(sys.platform, "win32")
|
|
self.assertTrue(sysconfig.get_platform().startswith("mingw"))
|
|
@@ -241,6 +244,21 @@ class Tests(unittest.TestCase):
|
|
self.assertEqual(platform.system(), "Windows")
|
|
self.assertTrue(isinstance(sys.api_version, int) and sys.api_version > 0)
|
|
|
|
+ with tempfile.TemporaryDirectory() as tmp:
|
|
+ builder = venv.EnvBuilder()
|
|
+ builder.create(tmp)
|
|
+ # This will not work in in-tree build
|
|
+ if not sysconfig.is_python_build():
|
|
+ op = subprocess.check_output(
|
|
+ [
|
|
+ os.path.join(tmp, "bin", "python.exe"),
|
|
+ "-c",
|
|
+ "import sysconfig; print(sysconfig.get_config_var('LIBDIR'))"
|
|
+ ],
|
|
+ cwd=tmp,
|
|
+ )
|
|
+ self.assertTrue(op.decode().strip().startswith(sys.base_prefix))
|
|
+
|
|
def test_sys_getpath(self):
|
|
# everything sourced from getpath.py
|
|
import sys
|