1 Star 0 Fork 0

joyni/vscode-python

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
testlauncher.py 984 Bytes
一键复制 编辑 原始数据 按行查看 历史
# 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.
"""
return (sys.argv[1], sys.argv[2], sys.argv[3:])
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)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/luluunusually/vscode-python.git
git@gitee.com:luluunusually/vscode-python.git
luluunusually
vscode-python
vscode-python
master

搜索帮助