MINGW-packages/mingw-w64-python/0098-smoketests-add-some-tests-for-sys-site-paths.patch
2025-10-10 14:31:04 +02:00

44 lines
1.4 KiB
Diff

From 99d67c56451bfad7961e7a06d8fc16a21d3f65e6 Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Fri, 28 Jul 2023 20:15:01 +0200
Subject: [PATCH 098/N] smoketests: add some tests for sys/site paths
---
mingw_smoketests.py | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/mingw_smoketests.py b/mingw_smoketests.py
index 00601f9..516005c 100644
--- a/mingw_smoketests.py
+++ b/mingw_smoketests.py
@@ -238,6 +238,29 @@ class Tests(unittest.TestCase):
self.assertEqual(platform.system(), "Windows")
self.assertTrue(isinstance(sys.api_version, int) and sys.api_version > 0)
+ def test_sys_getpath(self):
+ # everything sourced from getpath.py
+ import sys
+
+ def assertNormpath(path):
+ self.assertEqual(path, os.path.normpath(path))
+
+ assertNormpath(sys.executable)
+ assertNormpath(sys._base_executable)
+ assertNormpath(sys.prefix)
+ assertNormpath(sys.base_prefix)
+ assertNormpath(sys.exec_prefix)
+ assertNormpath(sys.base_exec_prefix)
+ assertNormpath(sys.platlibdir)
+ assertNormpath(sys._stdlib_dir)
+ for p in sys.path:
+ assertNormpath(p)
+
+ def test_site(self):
+ import site
+
+ self.assertEqual(len(site.getsitepackages()), 1)
+
def test_c_ext_build(self):
import tempfile
import sys