mirror of
https://github.com/microsoft/debugpy.git
synced 2025-12-23 08:48:12 +00:00
Wait for commands instead of just expecting them.
This commit is contained in:
parent
cdd42180ba
commit
b18b9ced29
1 changed files with 9 additions and 2 deletions
|
|
@ -287,8 +287,8 @@ class PyDevdLifecycle(object):
|
|||
|
||||
@contextlib.contextmanager
|
||||
def _wait_for_initialized(self):
|
||||
with self._fix.expect_command(CMD_REDIRECT_OUTPUT):
|
||||
with self._fix.expect_command(CMD_RUN):
|
||||
with self._fix.wait_for_command(CMD_REDIRECT_OUTPUT):
|
||||
with self._fix.wait_for_command(CMD_RUN):
|
||||
yield
|
||||
|
||||
def _initialize(self):
|
||||
|
|
@ -529,6 +529,13 @@ class PyDevdFixture(FixtureBase):
|
|||
if self._hidden:
|
||||
self.msgs.next_request()
|
||||
|
||||
@contextlib.contextmanager
|
||||
def wait_for_command(self, cmdid, *args, **kwargs):
|
||||
with self.fake.wait_for_command(cmdid, *args, **kwargs):
|
||||
yield
|
||||
if self._hidden:
|
||||
self.msgs.next_request()
|
||||
|
||||
def set_response(self, cmdid, payload, **kwargs):
|
||||
self.fake.add_pending_response(cmdid, payload, **kwargs)
|
||||
if self._hidden:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue