1 # Copyright (c) Microsoft Corporation. All rights reserved.
2 # Licensed under the MIT License.
9 """Parses arguments for use with the test launcher.
12 2. Test runner, `pytest` or `nose`
13 3. Rest of the arguments are passed into the test runner.
16 return (sys.argv[1], sys.argv[2], sys.argv[3:])
19 def exclude_current_file_from_debugger():
20 # Load the debugger package
23 import ptvsd.debugger as vspd
24 vspd.DONT_DEBUG.append(os.path.normcase(__file__))
28 Internal error detected. Please copy the above traceback and report at
29 https://github.com/Microsoft/vscode-python/issues/new
31 Press Enter to close. . .''')
39 def run(cwd, testRunner, args):
41 cwd -- the current directory to be set
42 testRunner -- test runner to be used `pytest` or `nose`
43 args -- arguments passed into the test runner
46 sys.path[0] = os.getcwd()
50 if testRunner == 'pytest':
61 if __name__ == '__main__':
62 exclude_current_file_from_debugger()
63 cwd, testRunner, args = parse_argv()
64 run(cwd, testRunner, args)