Skip to content

Commit

Permalink
mingw_smoketests: add a test to check if sysconfig returns correct va…
Browse files Browse the repository at this point in the history
…lues for `LIBDIR`
  • Loading branch information
naveen521kk committed Jan 1, 2024
1 parent cdf7ec2 commit 590eaa4
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions mingw_smoketests.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ def test_platform_things(self):
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"))
Expand All @@ -241,6 +244,21 @@ def test_platform_things(self):
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
Expand Down

0 comments on commit 590eaa4

Please sign in to comment.