Skip to content

Commit 9cb1166

Browse files
committed
Fix test_embed by creating expected paths instead of ignoring stderr
Signed-off-by: Filipe Laíns <lains@riseup.net>
1 parent 540d965 commit 9cb1166

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

Lib/test/test_embed.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,6 +1479,10 @@ def test_init_setpythonhome(self):
14791479
stdlib = os.path.join(home, sys.platlibdir, f'python{version}{ABI_THREAD}')
14801480
expected_paths = self.module_search_paths(prefix=home, exec_prefix=home)
14811481

1482+
# Create the expected paths to avoid the bad stdlib dir warning
1483+
for entry in expected_paths:
1484+
os.makedirs(entry, exist_ok=True)
1485+
14821486
config = {
14831487
'home': home,
14841488
'module_search_paths': expected_paths,
@@ -1492,8 +1496,7 @@ def test_init_setpythonhome(self):
14921496
self.default_program_name(config)
14931497
env = {'TESTHOME': home, 'PYTHONPATH': paths_str}
14941498
self.check_all_configs("test_init_setpythonhome", config,
1495-
api=API_COMPAT, env=env,
1496-
ignore_stderr=True) # ignore missing stdlib warning
1499+
api=API_COMPAT, env=env)
14971500

14981501
def test_init_is_python_build_with_home(self):
14991502
# Test _Py_path_config._is_python_build configuration (gh-91985)
@@ -1521,6 +1524,10 @@ def test_init_is_python_build_with_home(self):
15211524
stdlib = os.path.join(home, sys.platlibdir, f'python{version}{ABI_THREAD}')
15221525
expected_paths = self.module_search_paths(prefix=home, exec_prefix=home)
15231526

1527+
# Create the expected paths to avoid the bad stdlib dir warning
1528+
for entry in expected_paths:
1529+
os.makedirs(entry, exist_ok=True)
1530+
15241531
config = {
15251532
'home': home,
15261533
'module_search_paths': expected_paths,
@@ -1537,8 +1544,7 @@ def test_init_is_python_build_with_home(self):
15371544
env['NEGATIVE_ISPYTHONBUILD'] = '1'
15381545
config['_is_python_build'] = 0
15391546
self.check_all_configs("test_init_is_python_build", config,
1540-
api=API_COMPAT, env=env,
1541-
ignore_stderr=True) # ignore missing stdlib warning
1547+
api=API_COMPAT, env=env)
15421548

15431549
env['NEGATIVE_ISPYTHONBUILD'] = '0'
15441550
config['_is_python_build'] = 1
@@ -1554,8 +1560,7 @@ def test_init_is_python_build_with_home(self):
15541560
config.update(prefix=prefix, base_prefix=prefix,
15551561
exec_prefix=exec_prefix, base_exec_prefix=exec_prefix)
15561562
self.check_all_configs("test_init_is_python_build", config,
1557-
api=API_COMPAT, env=env,
1558-
ignore_stderr=True) # ignore missing stdlib warning
1563+
api=API_COMPAT, env=env)
15591564

15601565
def copy_paths_by_env(self, config):
15611566
all_configs = self._get_expected_config()

0 commit comments

Comments
 (0)