GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — vscode-python/pythonFiles/testlauncher.py at main · carreter/vscode-python Expand file tree/ Copy pathtestlauncher.pyMore file actions 51 lines (39 loc) · 1.15 KB / Copy pathtestlauncher.pyFile metadata and controls51 lines (39 loc) · 1.15 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import os import sys def parse_argv(): """Parses arguments for use with the test launcher. Arguments are: 1. Working directory. 2. Test runner, `pytest` or `nose` 3. Rest of the arguments are passed into the test runner. """ cwd = sys.argv[1] testRunner = sys.argv[2] args = sys.argv[3:] if testRunner == "nose": # Nose expects the program name to be first argument in vargs args.insert(0, sys.argv[0]) return (cwd, testRunner, args) def run(cwd, testRunner, args): """Runs the test cwd -- the current directory to be set testRunner -- test runner to be used `pytest` or `nose` args -- arguments passed into the test runner """ sys.path[0] = os.getcwd() os.chdir(cwd) try: if testRunner == "pytest": import pytest pytest.main(args) else: import nose nose.run(argv=args) sys.exit(0) finally: pass if __name__ == "__main__": cwd, testRunner, args = parse_argv() run(cwd, testRunner, args) |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |