Skip to content

Commit aafbdb5

Browse files
authored
gh-133742: Fix test_sysconfig and test_build_details for relocated directories (#136987)
1 parent 4d02f31 commit aafbdb5

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

Lib/test/test_build_details.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ def test_location(self):
124124
def test_base_interpreter(self):
125125
value = self.key('base_interpreter')
126126

127+
# Skip check if installation is relocated
128+
if sysconfig._installation_is_relocated():
129+
self.skipTest("Installation is relocated")
130+
127131
self.assertEqual(os.path.realpath(value), os.path.realpath(sys.executable))
128132

129133
@needs_installed_python
@@ -133,6 +137,11 @@ def test_base_interpreter(self):
133137
)
134138
def test_c_api(self):
135139
value = self.key('c_api')
140+
141+
# Skip check if installation is relocated
142+
if sysconfig._installation_is_relocated():
143+
self.skipTest("Installation is relocated")
144+
136145
self.assertTrue(os.path.exists(os.path.join(value['headers'], 'Python.h')))
137146
version = sysconfig.get_config_var('VERSION')
138147
self.assertTrue(os.path.exists(os.path.join(value['pkgconfig_path'], f'python-{version}.pc')))

Lib/test/test_sysconfig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ def test_sysconfigdata_json(self):
708708
ignore_keys |= {'prefix', 'exec_prefix', 'base', 'platbase'}
709709
# Keys dependent on Python being run from the prefix targetted when building (different on relocatable installs)
710710
if sysconfig._installation_is_relocated():
711-
ignore_keys |= {'prefix', 'exec_prefix', 'base', 'platbase', 'installed_base', 'installed_platbase'}
711+
ignore_keys |= {'prefix', 'exec_prefix', 'base', 'platbase', 'installed_base', 'installed_platbase', 'srcdir'}
712712

713713
for key in ignore_keys:
714714
json_config_vars.pop(key, None)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy