gh-117711: Only check for 'test/wheeldata' when it's actually used (#117712)

It's possible to build Python with option `--with-wheel-pkg-dir`
pointing to a custom wheel directory. Don't include the directory in the test
set if the wheels are used from a different location.

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
This commit is contained in:
Karolina Surma 2024-04-11 11:37:28 +02:00 committed by GitHub
parent 02f1385f8a
commit d4963871b0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -67,6 +67,10 @@ class TestMakefile(unittest.TestCase):
)
used.append(relpath)
# Don't check the wheel dir when Python is built --with-wheel-pkg-dir
if sysconfig.get_config_var('WHEEL_PKG_DIR'):
test_dirs.remove('test/wheeldata')
# Check that there are no extra entries:
unique_test_dirs = set(test_dirs)
self.assertSetEqual(unique_test_dirs, set(used))