python 出现错误:InvalidManifestError:while configure pytest

hfwmuf9z  于 6个月前  发布在  Python
关注(0)|答案(1)|浏览(58)

步骤:
1.我被安装了-->

$ pre-commit install
pre-commit installed at .git/hooks/pre-commit

字符串
2.创建.pre-commit-config.yaml文件,然后添加配置。这是我的pytest配置

- repo: https://github.com/pytest-dev/pytest
    rev: 7.4.3 
    hooks:
      - id: pytest


while run the pre-commit run --all-files i got error on pytest section
错误类型:

[INFO] Initializing environment for https://github.com/pytest-dev/pytest.
An error has occurred: InvalidManifestError: 
=====> /home/mutharasu/.cache/pre-commit/repofxmga3dy/.pre-commit-hooks.yaml is not a file


检查日志/home/mutharasu/. cache/pre-commit/pre-commit.log
我希望成功运行pre-commit run --all-files命令

pgky5nke

pgky5nke1#

pytest-dev/pytest不提供与pre-commit一起使用的钩子--也就是说,它不包含带有信息的.pre-commit-hooks.yaml文件。
我不知道你从哪里找到的yaml片段,但它是无效的(也许你编造的?)
作为一个pytest核心开发者和pre-commit的创建者,它不应该--将测试作为提交的一部分运行太慢了,而且会让你的贡献者感到沮丧。另外,pre-commit从不安装“repository under test”,所以你将无法使用任何依赖项。

相关问题