测试yaml文件中定义的可执行文件的玩具项目
test-exe-matrix的Python项目详细描述
包装纸py.测试运行UNIX命令并检查它们的一些行为。在
目录
Installation and running
Main requirements
- 类UNIX
- Python 3.6、3.7或3.8
From PyPA (pip install)
Install
最新的打包版本可以与pip一起安装,并带有与您的用例[1]相关的选项。在
[1] | For instance ^{tt2}$, or install in a virtualenv. |
pip install test_exe_matrix
Run
^{pr2}$From source with poetry
Install
关于poetry的注意事项:您可以从pip(pip install --user poetry)[2]安装它,也可以遵循以下步骤 the instructions 在official Web site上。在
^{tb2}$git clone https://framagit.org/feth/test_exe_matrix.git
cd test_exe_matrix
poetry install
Run
poetry run test_exe_matrix [arguments...]
Command line options
典型用途:
[poetry run] test_exe_matrix
Synopsys公司:
usage: test_exe_matrix [-h] [-V] [--collect-only] [-v] [--markers]
[-m PYTEST_ARGS]
[testsuite [testsuite ...]]
Test command lines listed in yaml files.
positional arguments:
testsuite testsuite yaml file -see example
test_exe_matrix/matrix.yaml.
Argument can be specified multiple times
optional arguments:
-h, --help show this help message and exit
-V, --version show program's version number and exit
--collect-only Only collect tests, without running them.
-v Increase verbosity.
--markers Lists registered test markers.
-m PYTEST_ARGS Only run tests that match selection expression, ie. '-m "not
internet"'
test_exe_matrix is mainly a Py.test wrapper
-v添加了非常漂亮的颜色,这归功于py.测试. 在
Parametrizing tests
把你的测试套件放在山药里,比如矩阵.yaml(提供),或几个。每个yaml文件都有一个单独的全局配置(标记声明和常规超时)。在
Optional values
- timeout
- 允许的运行时间(秒)。在这个延迟之后程序将被终止。默认为config/timeout或1。
- retcode
- 预期返回代码。
- stdout
- 预期标准输出(完全匹配)
- stderr
- 预期标准错误(完全匹配)
- partstdout
- 标准输出中应有子字符串。
- partstderr
- 标准错误中应有子字符串。
- notinstdout
- 标准输出中不需要子字符串。
- notinsderr
- 标准错误中不应有子字符串。
- args
- 程序的参数列表。
- name
- 正在进行的测试的说明。
- expect\u太长
- 布尔值:程序是否会超过时间限制运行。
- markers
- 测试标记列表。你可以使用标准py.测试标记(尤其是“xfail”:表示“预期失败”)或自定义标记,这些标记必须在config节中声明。
Example
完整的(希望如此)示例文件提供为“矩阵.yaml”. 在
举个例子,你可以
test_exe_matrix matrix.yaml --collect-only
列出测试,以及
test_exe_matrix matrix.yaml -v -m "not internet and not slow"
取消选择所有需要Internet和慢速测试的测试。在
^{1}$Dev: Build the package
这个项目使用诗歌。做
poetry build
一个pip可安装的轮子包将出现在dist/下。为 实例中,您可以安装:
pip3 install dist/test_exe_matrix-0.0.18-py3-none-any.whl
Other packaging
Debian/Fedora/Conda包是件好事,但我不知道从哪里开始。如果我不得不放弃诗歌,就随它去吧。帮助欢迎。在
Licence
根据CeCILL 2.1和GPL 2向公众提供双重许可(由您选择),请参阅文件LICENSE_chcecill_2.1.txt和LICENSE_GPL_2.txt。在
这些是兼容的copyleft许可证;cecill2.1至少更适合法国。在
其他需求:联系我。在
Thank you
Stéphane Bortzmeyer曾经问过是否存在一个测试命令结果的简单工具,然后报告了错误/编写了helpful framagit/gitlab上的门票,以指导开发。在
- 项目
标签: