代码拉取完成,页面将自动刷新
# 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)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。