summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-08-23 22:52:48 (GMT)
committerGitHub <noreply@github.com>2023-08-23 22:52:48 (GMT)
commit7a6cc3eb66805e6515d5db5b79e58e2f76b550c8 (patch)
tree1cd953717b3d6d35d2b8fd0f800965f58ff48d37
parent3107b453bcceb0e2d2590fef3612859f2f802d72 (diff)
downloadcpython-7a6cc3eb66805e6515d5db5b79e58e2f76b550c8.zip
cpython-7a6cc3eb66805e6515d5db5b79e58e2f76b550c8.tar.gz
cpython-7a6cc3eb66805e6515d5db5b79e58e2f76b550c8.tar.bz2
test_peg_generator and test_freeze require cpu (#108386)
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.
-rw-r--r--Lib/test/test_peg_generator/__init__.py6
-rw-r--r--Lib/test/test_tools/__init__.py6
-rw-r--r--Lib/test/test_tools/test_freeze.py3
3 files changed, 5 insertions, 10 deletions
diff --git a/Lib/test/test_peg_generator/__init__.py b/Lib/test/test_peg_generator/__init__.py
index 87281eb..c23542e 100644
--- a/Lib/test/test_peg_generator/__init__.py
+++ b/Lib/test/test_peg_generator/__init__.py
@@ -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
diff --git a/Lib/test/test_tools/__init__.py b/Lib/test/test_tools/__init__.py
index dde5d84..c4395c7 100644
--- a/Lib/test/test_tools/__init__.py
+++ b/Lib/test/test_tools/__init__.py
@@ -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")
diff --git a/Lib/test/test_tools/test_freeze.py b/Lib/test/test_tools/test_freeze.py
index 2ba36ca..3e9a48b 100644
--- a/Lib/test/test_tools/test_freeze.py
+++ b/Lib/test/test_tools/test_freeze.py
@@ -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...')