1 Star 0 Fork 0

finlecture/pywinpty

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
runtests.py 1.24 KB
一键复制 编辑 原始数据 按行查看 历史
# -*- coding: utf-8 -*-
"""Script used to run pytest programatically."""
# Standard library imports
import argparse
import os
# Standard library imports
import pytest
import traceback
def run_pytest(extra_args=None):
pytest_args = ['-v', '-x']
# Allow user to pass a custom test path to pytest to e.g. run just one test
if extra_args:
pytest_args += extra_args
print("Pytest Arguments: " + str(pytest_args))
errno = pytest.main(pytest_args)
# sys.exit doesn't work here because some things could be running in the
# background (e.g. closing the main window) when this point is reached.
# If that's the case, sys.exit doesn't stop the script as you would expect.
if errno != 0:
raise SystemExit(errno)
def main():
"""Parse args then run the pytest suite for pywinpty."""
test_parser = argparse.ArgumentParser(
usage='python runtests.py [-h] [pytest_args]',
description="Helper script to run pywinpty's test suite")
test_parser.add_argument('--run-slow', action='store_true', default=False,
help='Run the slow tests')
_, pytest_args = test_parser.parse_known_args()
run_pytest(extra_args=pytest_args)
if __name__ == '__main__':
main()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/finlecture/pywinpty.git
[email protected]:finlecture/pywinpty.git
finlecture
pywinpty
pywinpty
dependabot/cargo/either-1.13.0

搜索帮助