Skip to content

Commit 1118f6f

Browse files
committed
Add Emscripten test skips for recently added tests.
1 parent 6c9f7b4 commit 1118f6f

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

Lib/profiling/sampling/sample.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def _pause_threads(unwinder, blocking):
4141
except ImportError:
4242
LiveStatsCollector = None
4343

44-
_FREE_THREADED_BUILD = sysconfig.get_config_var("Py_GIL_DISABLED") is not None
44+
_FREE_THREADED_BUILD = bool(sysconfig.get_config_var("Py_GIL_DISABLED"))
4545
# Minimum number of samples required before showing the TUI
4646
# If fewer samples are collected, we skip the TUI and just print a message
4747
MIN_SAMPLES_FOR_TUI = 200

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)