Skip to content

Commit dad41ad

Browse files
committed
Skip if remote debugging not available
1 parent 3d60de9 commit dad41ad

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

Lib/profiling/sampling/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1104,7 +1104,7 @@ def _handle_live_run(args):
11041104
# Process still running - terminate it
11051105
process.terminate()
11061106
try:
1107-
process.wait(timeout=_PROCESS_KILL_TIMEOUT)
1107+
process.wait(timeout=_PROCESS_KILL_TIMEOUT_SEC)
11081108
except subprocess.TimeoutExpired:
11091109
process.kill()
11101110
# Ensure process is fully terminated

Lib/test/test_profiling/test_sampling_profiler/test_live_collector_ui.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import time
1212
import unittest
1313
from unittest import mock
14-
from test.support import requires, is_emscripten
14+
from test.support import requires, requires_remote_subprocess_debugging
1515
from test.support.import_helper import import_module
1616

1717
# Only run these tests if curses is available
@@ -821,6 +821,7 @@ def test_get_all_lines_full_display(self):
821821
self.assertTrue(any("PID" in line for line in lines))
822822

823823

824+
@requires_remote_subprocess_debugging()
824825
class TestLiveModeErrors(unittest.TestCase):
825826
"""Tests running error commands in the live mode fails gracefully."""
826827

@@ -837,7 +838,6 @@ def mock_init_curses_side_effect(self, n_times, mock_self, stdscr):
837838
if n_times >= 500:
838839
mock_self.display.simulate_input(ord('q'))
839840

840-
@unittest.skipIf(is_emscripten, "subprocess not available")
841841
def test_run_failed_module_live(self):
842842
"""Test that running a existing module that fails exists with clean error."""
843843

@@ -862,7 +862,6 @@ def test_run_failed_module_live(self):
862862
'\x1b[31mtest test_asdasd crashed -- Traceback (most recent call last):'
863863
)
864864

865-
@unittest.skipIf(is_emscripten, "subprocess not available")
866865
def test_run_failed_script_live(self):
867866
"""Test that running a failing script exits with clean error."""
868867
script = tempfile.NamedTemporaryFile(suffix=".py")

0 commit comments

Comments
 (0)