Skip to content

Commit

Permalink
test_peg_generator and test_freeze require cpu
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
vstinner committed Aug 23, 2023
1 parent ec3527d commit 7a0a718
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
6 changes: 2 additions & 4 deletions Lib/test/test_peg_generator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
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
Expand Down
6 changes: 0 additions & 6 deletions Lib/test/test_tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@
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")

Expand Down
3 changes: 3 additions & 0 deletions Lib/test/test_tools/test_freeze.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
class TestFreeze(unittest.TestCase):

def test_freeze_simple_script(self):
# Building Python is slow
support.requires('cpu')

script = textwrap.dedent("""
import sys
print('running...')
Expand Down

0 comments on commit 7a0a718

Please sign in to comment.