1 Star 0 Fork 0

NatureLiu/leo-editor

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
run_pytest_tests.py 868 Bytes
一键复制 编辑 原始数据 按行查看 历史
#@+leo-ver=5-thin
#@+node:ekr.20181014073705.1: * @file ../../run_pytest_tests.py
import sys
import pytest
path = sys.argv[-1]
args = [
'--quiet',
# '--setup-plan',
# '-x', # Exit on first error.
path, # File or directory
]
ignore_paths = []
for ignore_path in ignore_paths:
args.append(ignore_path)
result = pytest.main(args)
result_kinds = [
'All tests were collected and passed successfully',
'Tests were collected and run but some of the tests failed',
'Test execution was interrupted by the user',
'Internal error happened while executing tests',
'pytest command line usage error',
'No tests were collected',
]
message = f"{path}: {result}:{result_kinds[result]}"
if result == 5:
sys.stdout.write(message)
sys.stdout.flush()
if result not in (1, 5):
sys.stderr.write(message)
sys.stdout.flush()
#@-leo
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ulipcb/leo-editor.git
git@gitee.com:ulipcb/leo-editor.git
ulipcb
leo-editor
leo-editor
devel

搜索帮助

0d507c66 1850385 C8b1a773 1850385