Skip to content

Commit ec086ad

Browse files
committed
Make pylsp test driver use direct I/O in verbose mode
1 parent a6e17ee commit ec086ad

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

testsuite/drivers/pylsp.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,14 @@ def run(self) -> None:
8282
str(python_file),
8383
]
8484

85-
for _ in range(0, self.env.main_options.verbose): # type: ignore
85+
assert self.env.main_options
86+
for _ in range(0, self.env.main_options.verbose):
8687
# Transfer -v arguments to the Python test driver to reflect verbosity
8788
cmd += ["-v"]
8889

90+
if self.env.main_options.debug:
91+
cmd.append("--debug")
92+
8993
# Spawn a child Python process to run the test, to avoid lingering file
9094
# handles which can create issues on Windows when the test work dir is
9195
# cleaned up after execution.
@@ -95,9 +99,9 @@ def run(self) -> None:
9599
"PYTHONPATH": os.path.dirname(os.path.dirname(__file__)),
96100
}
97101

98-
assert self.env.main_options
99-
if self.env.main_options.debug:
100-
cmd.append("--debug")
102+
if self.env.main_options.debug or self.env.main_options.verbose:
103+
# In this case we use Run directly without piping options to connect the
104+
# subprocess directly to the parent I/O.
101105

102106
LOG.info(f"Run: cd {wd}; {command_line_image(cmd)}")
103107
r = Run(

0 commit comments

Comments
 (0)