Skip to content

Commit 503075e

Browse files
committed
[lldb][test][NFC] Narrow scope of import pexpect
We do not run `pexpect` based tests on Windows, but there are still cases where those tests run `import pexpect` outside of the scope where the test is skipped. By moving the import statement to a different scope, those tests can run even when `pexpect` truly isn't installed. Tangentially related: TestSTTYBeforeAndAfter.py is using a manual `@expectedFailureAll` for windows instead of the common `@skipIfWindows`. If `pexepect` is generally expected to not be available, we should not bother running the test at all.
1 parent b32845c commit 503075e

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

lldb/test/API/driver/quit_speed/TestQuitWithProcess.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22
Test that killing the target while quitting doesn't stall
33
"""
44

5-
65
import lldb
76
from lldbsuite.test.decorators import *
87
from lldbsuite.test.lldbtest import *
98
from lldbsuite.test import lldbutil
10-
import pexpect
119
from lldbsuite.test.lldbpexpect import PExpectTest
1210

1311

@@ -16,6 +14,8 @@ class DriverQuitSpeedTest(PExpectTest):
1614

1715
def test_run_quit(self):
1816
"""Test that the lldb driver's batch mode works correctly."""
17+
import pexpect
18+
1919
self.build()
2020

2121
exe = self.getBuildArtifact("a.out")

lldb/test/API/functionalities/progress_reporting/TestTrimmedProgressReporting.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"""
44

55
import os
6-
import pexpect
76
import tempfile
87
import re
98

lldb/test/API/terminal/TestSTTYBeforeAndAfter.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ def classCleanup(cls):
1919
cls.RemoveTempFile("child_send2.txt")
2020
cls.RemoveTempFile("child_read2.txt")
2121

22-
@expectedFailureAll(
23-
hostoslist=["windows"],
24-
bugnumber="llvm.org/pr22274: need a pexpect replacement for windows",
25-
)
22+
@skipIfWindows # llvm.org/pr22274: need a pexpect replacement for windows
2623
@no_debug_info_test
2724
def test_stty_dash_a_before_and_afetr_invoking_lldb_command(self):
2825
"""Test that 'stty -a' displays the same output before and after running the lldb command."""

0 commit comments

Comments
 (0)