From 18b8679da9a124f3d9efcc2e877040bade73567c Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Wed, 7 Mar 2018 16:01:08 -0800 Subject: [PATCH 1/2] :hammer: launch debugger instead of attaching --- pythonFiles/PythonTools/testlauncher.py | 15 +-- .../visualstudio_py_testlauncher.py | 16 +-- src/client/unittests/common/debugLauncher.ts | 103 ++++-------------- src/client/unittests/common/types.ts | 3 - src/client/unittests/nosetest/runner.ts | 15 +-- src/client/unittests/pytest/runner.ts | 15 +-- src/client/unittests/unittest/runner.ts | 11 +- 7 files changed, 47 insertions(+), 131 deletions(-) diff --git a/pythonFiles/PythonTools/testlauncher.py b/pythonFiles/PythonTools/testlauncher.py index 397a841eb4e0..943173cd8b40 100644 --- a/pythonFiles/PythonTools/testlauncher.py +++ b/pythonFiles/PythonTools/testlauncher.py @@ -2,24 +2,15 @@ def main(): import os import sys from ptvsd.visualstudio_py_debugger import DONT_DEBUG, DEBUG_ENTRYPOINTS, get_code - from ptvsd.attach_server import DEFAULT_PORT, enable_attach, wait_for_attach sys.path[0] = os.getcwd() os.chdir(sys.argv[1]) - secret = sys.argv[2] - port = int(sys.argv[3]) - testFx = sys.argv[4] - args = sys.argv[5:] + testFx = sys.argv[2] + args = sys.argv[3:] DONT_DEBUG.append(os.path.normcase(__file__)) DEBUG_ENTRYPOINTS.add(get_code(main)) - enable_attach(secret, ('127.0.0.1', port), redirect_output = False) - sys.stdout.flush() - print('READY') - sys.stdout.flush() - wait_for_attach() - try: if testFx == 'pytest': import pytest @@ -32,4 +23,4 @@ def main(): pass if __name__ == '__main__': - main() \ No newline at end of file + main() diff --git a/pythonFiles/PythonTools/visualstudio_py_testlauncher.py b/pythonFiles/PythonTools/visualstudio_py_testlauncher.py index b0780fe51274..9464afddc6f1 100644 --- a/pythonFiles/PythonTools/visualstudio_py_testlauncher.py +++ b/pythonFiles/PythonTools/visualstudio_py_testlauncher.py @@ -199,8 +199,7 @@ def main(): global _channel parser = OptionParser(prog = 'visualstudio_py_testlauncher', usage = 'Usage: %prog [