]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
test_peg_generator and test_freeze require cpu (#108386)
authorVictor Stinner <vstinner@python.org>
Wed, 23 Aug 2023 22:52:48 +0000 (00:52 +0200)
committerGitHub <noreply@github.com>
Wed, 23 Aug 2023 22:52:48 +0000 (00:52 +0200)
The test_peg_generator and test_tools.test_freeze tests now require
the 'cpu' resource. Skip these tests unless the 'cpu' resource is
enabled (it is disabled by default).

These tests are no longer skipped if Python is built with ASAN or
MSAN sanitizer.

Lib/test/test_peg_generator/__init__.py
Lib/test/test_tools/__init__.py
Lib/test/test_tools/test_freeze.py

index 87281eb5e03c7f1c69661023ab8dac656d7223ef..c23542e254c99fa4a6eb3c34d80b555b054ea60b 100644 (file)
@@ -4,10 +4,8 @@ from test import support
 from test.support import load_package_tests
 
 
-if support.check_sanitizer(address=True, memory=True):
-    # gh-90791: Skip the test because it is too slow when Python is built
-    # with ASAN/MSAN: between 5 and 20 minutes on GitHub Actions.
-    raise unittest.SkipTest("test too slow on ASAN/MSAN build")
+# Creating a virtual environment and building C extensions is slow
+support.requires('cpu')
 
 
 # Load all tests in package
index dde5d84e9edc6b76b76bc3d0f19c60131742c81a..c4395c7c0ad0c986d9af82143207f94a35d636a6 100644 (file)
@@ -7,12 +7,6 @@ from test import support
 from test.support import import_helper
 
 
-if support.check_sanitizer(address=True, memory=True):
-    # gh-90791: Skip the test because it is too slow when Python is built
-    # with ASAN/MSAN: between 5 and 20 minutes on GitHub Actions.
-    raise unittest.SkipTest("test too slow on ASAN/MSAN build")
-
-
 if not support.has_subprocess_support:
     raise unittest.SkipTest("test module requires subprocess")
 
index 2ba36ca208f96733fd4ea597d5d895daf0ab2fdd..3e9a48b5bc6a89718c4e43c01ad31a51b0e27e0e 100644 (file)
@@ -18,6 +18,9 @@ with imports_under_tool('freeze', 'test'):
 class TestFreeze(unittest.TestCase):
 
     def test_freeze_simple_script(self):
+        # Building Python is slow
+        support.requires('cpu')
+
         script = textwrap.dedent("""
             import sys
             print('running...')