]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-120418: Don't assume wheeldata is deleted if `WHEEL_PKG_DIR` is set (#120419)
authorStefano Rivera <stefano@rivera.za.net>
Wed, 12 Jun 2024 19:19:36 +0000 (12:19 -0700)
committerGitHub <noreply@github.com>
Wed, 12 Jun 2024 19:19:36 +0000 (21:19 +0200)
Remove wheeldata from both sides of the `assertEqual`, so that we're
*actually* ignoring it from the test set.

This test is only making assertions about the source tree, no code is
being executed that would do anything different based on the value of
`WHEEL_PKG_DIR`.

Lib/test/test_tools/test_makefile.py

index 48a7c1a773bb83db93cf63871e0abfbad942c5b0..df95e6d0068516d25f007a59d3ac7118ce1308ce 100644 (file)
@@ -41,7 +41,7 @@ class TestMakefile(unittest.TestCase):
         idle_test = 'idlelib/idle_test'
         self.assertIn(idle_test, test_dirs)
 
-        used = [idle_test]
+        used = set([idle_test])
         for dirpath, dirs, files in os.walk(support.TEST_HOME_DIR):
             dirname = os.path.basename(dirpath)
             # Skip temporary dirs:
@@ -65,13 +65,14 @@ class TestMakefile(unittest.TestCase):
                         "of test directories to install"
                     )
                 )
-                used.append(relpath)
+                used.add(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')
+            used.discard('test/wheeldata')
 
         # Check that there are no extra entries:
         unique_test_dirs = set(test_dirs)
-        self.assertSetEqual(unique_test_dirs, set(used))
+        self.assertSetEqual(unique_test_dirs, used)
         self.assertEqual(len(test_dirs), len(unique_test_dirs))