Skip to content

Commit 448a707

Browse files
[3.11] gh-109615: Fix support test_copy_python_src_ignore() on WASM (GH-109970) (#109976)
gh-109615: Fix support test_copy_python_src_ignore() on WASM (GH-109970) Not only check if src_dir exists, but look also for Lib/os.py landmark. (cherry picked from commit cc54bcf) Co-authored-by: Victor Stinner <[email protected]>
1 parent cb0f41f commit 448a707

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

781781
def test_copy_python_src_ignore(self):
782+
# Get source directory
782783
src_dir = sysconfig.get_config_var('abs_srcdir')
783784
if not src_dir:
784785
src_dir = sysconfig.get_config_var('srcdir')
785786
src_dir = os.path.abspath(src_dir)
787+
788+
# Check that the source code is available
786789
if not os.path.exists(src_dir):
787790
self.skipTest(f"cannot access Python source code directory:"
788791
f" {src_dir!r}")
792+
landmark = os.path.join(src_dir, 'Lib', 'os.py')
793+
if not os.path.exists(landmark):
794+
self.skipTest(f"cannot access Python source code directory:"
795+
f" {landmark!r} landmark is missing")
789796

790-
ignored = {'.git', '__pycache__'}
797+
# Test support.copy_python_src_ignore()
791798

792799
# Source code directory
800+
ignored = {'.git', '__pycache__'}
793801
names = os.listdir(src_dir)
794802
self.assertEqual(support.copy_python_src_ignore(src_dir, names),
795803
ignored | {'build'})

0 commit comments

Comments
 (0)