Skip to content

Commit a81fd57

Browse files
committed
gh-136438: Make sure test_remote_pdb pass with all optimization levels
1 parent 03017a8 commit a81fd57

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Lib/test/test_remote_pdb.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ def test_handling_other_message(self):
279279
expected_stdout="Some message.\n",
280280
)
281281

282+
@unittest.skipIf(sys.flags.optimize >= 2, "Disabled for optimization -OO")
282283
def test_handling_help_for_command(self):
283284
"""Test handling a request to display help for a command."""
284285
incoming = [
@@ -290,6 +291,7 @@ def test_handling_help_for_command(self):
290291
expected_stdout_substring="Usage: ll | longlist",
291292
)
292293

294+
@unittest.skipIf(sys.flags.optimize >= 2, "Disabled for optimization -OO")
293295
def test_handling_help_without_a_specific_topic(self):
294296
"""Test handling a request to display a help overview."""
295297
incoming = [
@@ -301,6 +303,7 @@ def test_handling_help_without_a_specific_topic(self):
301303
expected_stdout_substring="type help <topic>",
302304
)
303305

306+
@unittest.skipIf(sys.flags.optimize >= 2, "Help not available for -OO")
304307
def test_handling_help_pdb(self):
305308
"""Test handling a request to display the full PDB manual."""
306309
incoming = [
@@ -312,6 +315,18 @@ def test_handling_help_pdb(self):
312315
expected_stdout_substring=">>> import pdb",
313316
)
314317

318+
@unittest.skipIf(sys.flags.optimize < 2, "Needs -OO")
319+
def test_handling_no_help_available(self):
320+
"""Test handling a request when no help if available."""
321+
incoming = [
322+
("server", {"help": "pdb"}),
323+
]
324+
self.do_test(
325+
incoming=incoming,
326+
expected_outgoing=[],
327+
expected_stdout_substring="No help for 'pdb'",
328+
)
329+
315330
def test_handling_pdb_prompts(self):
316331
"""Test responding to pdb's normal prompts."""
317332
incoming = [

0 commit comments

Comments
 (0)