Skip to content

Commit cc54bcf

Browse files
authored
gh-109615: Fix support test_copy_python_src_ignore() on WASM (#109970)
Not only check if src_dir exists, but look also for Lib/os.py landmark.
1 parent 773614e commit cc54bcf

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Lib/test/test_support.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -802,17 +802,25 @@ def test_set_memlimit(self):
802802
support.real_max_memuse = old_real_max_memuse
803803

804804
def test_copy_python_src_ignore(self):
805+
# Get source directory
805806
src_dir = sysconfig.get_config_var('abs_srcdir')
806807
if not src_dir:
807808
src_dir = sysconfig.get_config_var('srcdir')
808809
src_dir = os.path.abspath(src_dir)
810+
811+
# Check that the source code is available
809812
if not os.path.exists(src_dir):
810813
self.skipTest(f"cannot access Python source code directory:"
811814
f" {src_dir!r}")
815+
landmark = os.path.join(src_dir, 'Lib', 'os.py')
816+
if not os.path.exists(landmark):
817+
self.skipTest(f"cannot access Python source code directory:"
818+
f" {landmark!r} landmark is missing")
812819

813-
ignored = {'.git', '__pycache__'}
820+
# Test support.copy_python_src_ignore()
814821

815822
# Source code directory
823+
ignored = {'.git', '__pycache__'}
816824
names = os.listdir(src_dir)
817825
self.assertEqual(support.copy_python_src_ignore(src_dir, names),
818826
ignored | {'build'})

0 commit comments

Comments
 (0)