问题描述
我想利用标记来运行 pytest 套件。 流程如下:
- 在配置文件中指定标记列表
- 在 tox.ini 文件中读取此参数并在运行时动态使用它
- 将使用 jenkins 自动化测试套件 我知道在 tox.ini 文件中可以有静态参数 Official document
使用此 this thread 中的 pll 示例
[main]
ignore_list = "E201,E202,E203,E221,E231,E241,E265,E266,E272,E402,W293,W391"
# to be read from another file
[testenv]
commands =
pep8 \
--max-line-length=120 \
--ignore={[main]ignore_list}
解决方法
您可以创建一个 bash 脚本来读取忽略列表,然后构建命令并最终运行它,而不是直接调用 pep8
。