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 Nov 8, 2023
1 parent e66e4f7 commit 6f1c03b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 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,20 @@ 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)
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 6f1c03b

Please sign in to comment.