]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Add Emscripten test skips for recently added tests. (#143551)
authorRussell Keith-Magee <russell@keith-magee.com>
Thu, 8 Jan 2026 21:47:38 +0000 (05:47 +0800)
committerGitHub <noreply@github.com>
Thu, 8 Jan 2026 21:47:38 +0000 (05:47 +0800)
Some recent changes introduced tests that can't run on Emscripten.
This change adds test skips for those tests.

Lib/test/test_grammar.py
Lib/test/test_profiling/test_sampling_profiler/test_cli.py
Lib/test/test_profiling/test_sampling_profiler/test_collectors.py

index cfb24a5c45782082ff0870ba301d25d0bc5c3d15..ebcd98a0a37776d4cb91c46e64ea34a8150ccebf 100644 (file)
@@ -1,8 +1,6 @@
 # Python test set -- part 1, grammar.
 # This just tests whether the parser accepts them all.
 
-from test.support import check_syntax_error, skip_wasi_stack_overflow
-from test.support import import_helper
 import annotationlib
 import inspect
 import unittest
@@ -18,6 +16,12 @@ import test.typinganndata.ann_module as ann_module
 import typing
 from test.typinganndata import ann_module2
 import test
+from test.support import (
+    check_syntax_error,
+    import_helper,
+    skip_emscripten_stack_overflow,
+    skip_wasi_stack_overflow,
+)
 from test.support.numbers import (
     VALID_UNDERSCORE_LITERALS,
     INVALID_UNDERSCORE_LITERALS,
@@ -250,6 +254,7 @@ the \'lazy\' dog.\n\
             self.assertIn("was never closed", str(cm.exception))
 
     @skip_wasi_stack_overflow()
+    @skip_emscripten_stack_overflow()
     def test_max_level(self):
         # Macro defined in Parser/lexer/state.h
         MAXLEVEL = 200
index f187f6c51d88e2bdf7a1d02f14472af5e4017a5e..0d92bd1796e9afdb27b7459f2ec1a9b07b0edc27 100644 (file)
@@ -714,6 +714,7 @@ class TestSampleProfilerCLI(unittest.TestCase):
             with self.assertRaisesRegex(SamplingModuleNotFoundError, "Module '[\\w/.]+' not found."):
                 main()
 
+    @unittest.skipIf(is_emscripten, "subprocess not available")
     def test_cli_attach_nonexistent_pid(self):
         fake_pid = "99999"
         with mock.patch("sys.argv", ["profiling.sampling.cli", "attach", fake_pid]):
index ae336ccdb941cead0e79c122ebcf5903672545f1..8e6afa91e89dafa022ed3fb9f29d697ea24beb38 100644 (file)
@@ -7,6 +7,8 @@ import os
 import tempfile
 import unittest
 
+from test.support import is_emscripten
+
 try:
     import _remote_debugging  # noqa: F401
     from profiling.sampling.pstats_collector import PstatsCollector
@@ -599,6 +601,7 @@ class TestSampleProfilerComponents(unittest.TestCase):
         self.assertGreater(stack_table["length"], 0)
         self.assertGreater(len(stack_table["frame"]), 0)
 
+    @unittest.skipIf(is_emscripten, "threads not available")
     def test_gecko_collector_export(self):
         """Test Gecko profile export functionality."""
         gecko_out = tempfile.NamedTemporaryFile(suffix=".json", delete=False)