diff --git a/news/3 Code Health/983.md b/news/3 Code Health/983.md new file mode 100644 index 000000000000..bd0250359c96 --- /dev/null +++ b/news/3 Code Health/983.md @@ -0,0 +1 @@ +Launch the unit tests in debug mode as opposed to running and attaching the debugger. 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 [