mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
[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 cc54bcf17b
)
Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
parent
cb0f41f232
commit
448a7071b1
1 changed files with 9 additions and 1 deletions
|
@ -779,17 +779,25 @@ class TestSupport(unittest.TestCase):
|
|||
#self.assertEqual(available, 2)
|
||||
|
||||
def test_copy_python_src_ignore(self):
|
||||
# Get source directory
|
||||
src_dir = sysconfig.get_config_var('abs_srcdir')
|
||||
if not src_dir:
|
||||
src_dir = sysconfig.get_config_var('srcdir')
|
||||
src_dir = os.path.abspath(src_dir)
|
||||
|
||||
# Check that the source code is available
|
||||
if not os.path.exists(src_dir):
|
||||
self.skipTest(f"cannot access Python source code directory:"
|
||||
f" {src_dir!r}")
|
||||
landmark = os.path.join(src_dir, 'Lib', 'os.py')
|
||||
if not os.path.exists(landmark):
|
||||
self.skipTest(f"cannot access Python source code directory:"
|
||||
f" {landmark!r} landmark is missing")
|
||||
|
||||
ignored = {'.git', '__pycache__'}
|
||||
# Test support.copy_python_src_ignore()
|
||||
|
||||
# Source code directory
|
||||
ignored = {'.git', '__pycache__'}
|
||||
names = os.listdir(src_dir)
|
||||
self.assertEqual(support.copy_python_src_ignore(src_dir, names),
|
||||
ignored | {'build'})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue