From 72c549c6f5b511dd514dc0011ffbdcac81b4abfc Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Thu, 17 Jan 2019 11:02:33 -0800 Subject: [PATCH] Restrict wait on exit tests to launch only (#1104) --- src/ptvsd/wrapper.py | 2 +- tests/func/test_start_stop.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ptvsd/wrapper.py b/src/ptvsd/wrapper.py index a0a152f1..9970031c 100644 --- a/src/ptvsd/wrapper.py +++ b/src/ptvsd/wrapper.py @@ -1174,7 +1174,7 @@ class VSCLifecycleMsgProcessor(VSCodeMessageProcessorBase): self.send_event('exited', exitCode=exitcode or 0) self._waiting = True - if wait is not None: + if wait is not None and self.start_reason == 'launch': normal, abnormal = self._wait_options() cfg = (normal and not exitcode) or (abnormal and exitcode) # This must be done before we send a disconnect response diff --git a/tests/func/test_start_stop.py b/tests/func/test_start_stop.py index b5f9e823..df9d96e1 100644 --- a/tests/func/test_start_stop.py +++ b/tests/func/test_start_stop.py @@ -45,7 +45,7 @@ def test_break_on_entry(pyfile, run_as, start_method): session.wait_for_exit() -@pytest.mark.parametrize('start_method', ['launch', 'attach_socket_cmdline']) +@pytest.mark.parametrize('start_method', ['launch']) @pytest.mark.skipif(sys.version_info < (3, 0) and platform.system() == 'Windows', reason="On Win32 Python2.7, unable to send key strokes to test.") def test_wait_on_normal_exit_enabled(pyfile, run_as, start_method): @@ -86,7 +86,7 @@ def test_wait_on_normal_exit_enabled(pyfile, run_as, start_method): assert u'Press' in decoded -@pytest.mark.parametrize('start_method', ['launch', 'attach_socket_cmdline']) +@pytest.mark.parametrize('start_method', ['launch']) @pytest.mark.skipif(sys.version_info < (3, 0) and platform.system() == 'Windows', reason="On windows py2.7 unable to send key strokes to test.") def test_wait_on_abnormal_exit_enabled(pyfile, run_as, start_method): @@ -132,7 +132,7 @@ def test_wait_on_abnormal_exit_enabled(pyfile, run_as, start_method): ) -@pytest.mark.parametrize('start_method', ['launch', 'attach_socket_cmdline']) +@pytest.mark.parametrize('start_method', ['launch']) def test_exit_normally_with_wait_on_abnormal_exit_enabled(pyfile, run_as, start_method): @pyfile