Skip to content

Commit c310ecb

Browse files
committed
pythongh-109615: Fix support test_copy_python_src_ignore() on WASM (python#109970)
Not only check if src_dir exists, but look also for Lib/os.py landmark. (cherry picked from commit cc54bcf)
1 parent b24ecb7 commit c310ecb

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
@@ -767,17 +767,25 @@ def recursive_function(depth):
767767
#self.assertEqual(available, 2)
768768

769769
def test_copy_python_src_ignore(self):
770+
# Get source directory
770771
src_dir = sysconfig.get_config_var('abs_srcdir')
771772
if not src_dir:
772773
src_dir = sysconfig.get_config_var('srcdir')
773774
src_dir = os.path.abspath(src_dir)
775+
776+
# Check that the source code is available
774777
if not os.path.exists(src_dir):
775778
self.skipTest(f"cannot access Python source code directory:"
776779
f" {src_dir!r}")
780+
landmark = os.path.join(src_dir, 'Lib', 'os.py')
781+
if not os.path.exists(landmark):
782+
self.skipTest(f"cannot access Python source code directory:"
783+
f" {landmark!r} landmark is missing")
777784

778-
ignored = {'.git', '__pycache__'}
785+
# Test support.copy_python_src_ignore()
779786

780787
# Source code directory
788+
ignored = {'.git', '__pycache__'}
781789
names = os.listdir(src_dir)
782790
self.assertEqual(support.copy_python_src_ignore(src_dir, names),
783791
ignored | {'build'})

0 commit comments

Comments
 (0)