跳转到主要内容

pytest的自动钩子插件

项目描述

Greenbone Logo

autohooks-plugin-pytest

PyPI release

pytest的autohooks插件。

安装

使用pip安装

您可以使用pip从Python包索引安装autohooks-plugin-pytest的最新稳定版本,请访问pip

python3 -m pip install autohooks-plugin-pytest

使用poetry安装

强烈建议使用poetry来维护项目的依赖项。通常autohooks-plugin-pytest被安装为开发依赖项。

poetry install

使用方法

要激活pytest自动钩子插件,请将以下设置添加到您的pyproject.toml文件中。

[tool.autohooks]
pre-commit = ["autohooks.plugins.pytest"]

默认情况下,autohooks插件pytest会检查所有以.py结尾的文件。如果只测试子目录中的文件或具有不同扩展名的文件,请添加以下设置

[tool.autohooks]
pre-commit = ["autohooks.plugins.pytest"]

[tool.autohooks.plugins.pytest]
include = ['foo/*.py', '*.foo']

默认情况下,autohooks插件pytest会执行不带任何参数的pytest,并从git仓库根目录的.pytestrc文件中加载pytest设置。要更改特定设置或定义不同的pytest rc文件,可以使用以下插件配置

[tool.autohooks]
pre-commit = ["autohooks.plugins.pytest"]

[tool.autohooks.plugins.pytest]
arguments = ["--rcfile=/path/to/pytestrc", "-s", "n"]

维护者

本项目由Greenbone AG维护。

贡献

我们非常欢迎您的贡献。请在GitHub上创建一个pull request。较大的更改需要先通过GitHub上的问题部分与开发团队进行讨论。

许可

版权 (C) 2021-2023 Greenbone AG

许可协议:GNU通用公共许可证v3.0或更高版本。

项目详情


下载文件

下载适用于您平台的项目文件。如果您不确定要选择哪个,请了解更多关于安装包的信息。

源分发

autohooks_plugin_pytest-23.10.0.tar.gz (15.5 kB 查看哈希值)

上传时间:

构建分发

autohooks_plugin_pytest-23.10.0-py3-none-any.whl (16.9 kB 查看哈希值)

上传时间: Python 3

支持者

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面