Skip to content

Commit 7a6cc3e

Browse files
authored
test_peg_generator and test_freeze require cpu (python#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.
1 parent 3107b45 commit 7a6cc3e

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

Lib/test/test_peg_generator/__init__.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@
44
from test.support import load_package_tests
55

66

7-
if support.check_sanitizer(address=True, memory=True):
8-
# gh-90791: Skip the test because it is too slow when Python is built
9-
# with ASAN/MSAN: between 5 and 20 minutes on GitHub Actions.
10-
raise unittest.SkipTest("test too slow on ASAN/MSAN build")
7+
# Creating a virtual environment and building C extensions is slow
8+
support.requires('cpu')
119

1210

1311
# Load all tests in package

Lib/test/test_tools/__init__.py

-6
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@
77
from test.support import import_helper
88

99

10-
if support.check_sanitizer(address=True, memory=True):
11-
# gh-90791: Skip the test because it is too slow when Python is built
12-
# with ASAN/MSAN: between 5 and 20 minutes on GitHub Actions.
13-
raise unittest.SkipTest("test too slow on ASAN/MSAN build")
14-
15-
1610
if not support.has_subprocess_support:
1711
raise unittest.SkipTest("test module requires subprocess")
1812

Lib/test/test_tools/test_freeze.py

+3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
class TestFreeze(unittest.TestCase):
1919

2020
def test_freeze_simple_script(self):
21+
# Building Python is slow
22+
support.requires('cpu')
23+
2124
script = textwrap.dedent("""
2225
import sys
2326
print('running...')

0 commit comments

Comments
 (0)