Skip to content

Commit b54a1d2

Browse files
authored
Add Emscripten test skips for recently added tests. (#143551)
Some recent changes introduced tests that can't run on Emscripten. This change adds test skips for those tests.
1 parent e2f15ae commit b54a1d2

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

Lib/test/test_grammar.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# Python test set -- part 1, grammar.
22
# This just tests whether the parser accepts them all.
33

4-
from test.support import check_syntax_error, skip_wasi_stack_overflow
5-
from test.support import import_helper
64
import annotationlib
75
import inspect
86
import unittest
@@ -18,6 +16,12 @@
1816
import typing
1917
from test.typinganndata import ann_module2
2018
import test
19+
from test.support import (
20+
check_syntax_error,
21+
import_helper,
22+
skip_emscripten_stack_overflow,
23+
skip_wasi_stack_overflow,
24+
)
2125
from test.support.numbers import (
2226
VALID_UNDERSCORE_LITERALS,
2327
INVALID_UNDERSCORE_LITERALS,
@@ -250,6 +254,7 @@ def test_eof_error(self):
250254
self.assertIn("was never closed", str(cm.exception))
251255

252256
@skip_wasi_stack_overflow()
257+
@skip_emscripten_stack_overflow()
253258
def test_max_level(self):
254259
# Macro defined in Parser/lexer/state.h
255260
MAXLEVEL = 200

Lib/test/test_profiling/test_sampling_profiler/test_cli.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,7 @@ def test_run_nonexistent_module_exits_cleanly(self):
714714
with self.assertRaisesRegex(SamplingModuleNotFoundError, "Module '[\\w/.]+' not found."):
715715
main()
716716

717+
@unittest.skipIf(is_emscripten, "subprocess not available")
717718
def test_cli_attach_nonexistent_pid(self):
718719
fake_pid = "99999"
719720
with mock.patch("sys.argv", ["profiling.sampling.cli", "attach", fake_pid]):

Lib/test/test_profiling/test_sampling_profiler/test_collectors.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
import tempfile
88
import unittest
99

10+
from test.support import is_emscripten
11+
1012
try:
1113
import _remote_debugging # noqa: F401
1214
from profiling.sampling.pstats_collector import PstatsCollector
@@ -599,6 +601,7 @@ def test_gecko_collector_basic(self):
599601
self.assertGreater(stack_table["length"], 0)
600602
self.assertGreater(len(stack_table["frame"]), 0)
601603

604+
@unittest.skipIf(is_emscripten, "threads not available")
602605
def test_gecko_collector_export(self):
603606
"""Test Gecko profile export functionality."""
604607
gecko_out = tempfile.NamedTemporaryFile(suffix=".json", delete=False)

0 commit comments

Comments
 (0)