https://github.com/python/cpython/commit/aafbdb5df5439adc1106ced068cf87683ae68b9e
commit: aafbdb5df5439adc1106ced068cf87683ae68b9e
branch: main
author: Pablo Galindo Salgado <[email protected]>
committer: pablogsal <[email protected]>
date: 2025-07-22T11:53:05Z
summary:

gh-133742: Fix test_sysconfig and test_build_details for relocated directories 
(#136987)

files:
M Lib/test/test_build_details.py
M Lib/test/test_sysconfig.py

diff --git a/Lib/test/test_build_details.py b/Lib/test/test_build_details.py
index ba4b8c5aa9b58e..691fd0bb98c097 100644
--- a/Lib/test/test_build_details.py
+++ b/Lib/test/test_build_details.py
@@ -124,6 +124,10 @@ def test_location(self):
     def test_base_interpreter(self):
         value = self.key('base_interpreter')
 
+        # Skip check if installation is relocated
+        if sysconfig._installation_is_relocated():
+            self.skipTest("Installation is relocated")
+
         self.assertEqual(os.path.realpath(value), 
os.path.realpath(sys.executable))
 
     @needs_installed_python
@@ -133,6 +137,11 @@ def test_base_interpreter(self):
     )
     def test_c_api(self):
         value = self.key('c_api')
+
+        # Skip check if installation is relocated
+        if sysconfig._installation_is_relocated():
+            self.skipTest("Installation is relocated")
+
         self.assertTrue(os.path.exists(os.path.join(value['headers'], 
'Python.h')))
         version = sysconfig.get_config_var('VERSION')
         self.assertTrue(os.path.exists(os.path.join(value['pkgconfig_path'], 
f'python-{version}.pc')))
diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py
index 2eb8de4b29fe96..4aaef5b142931e 100644
--- a/Lib/test/test_sysconfig.py
+++ b/Lib/test/test_sysconfig.py
@@ -708,7 +708,7 @@ def test_sysconfigdata_json(self):
             ignore_keys |= {'prefix', 'exec_prefix', 'base', 'platbase'}
         # Keys dependent on Python being run from the prefix targetted when 
building (different on relocatable installs)
         if sysconfig._installation_is_relocated():
-            ignore_keys |= {'prefix', 'exec_prefix', 'base', 'platbase', 
'installed_base', 'installed_platbase'}
+            ignore_keys |= {'prefix', 'exec_prefix', 'base', 'platbase', 
'installed_base', 'installed_platbase', 'srcdir'}
 
         for key in ignore_keys:
             json_config_vars.pop(key, None)

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to