Ai
1 Star 0 Fork 0

ai-performance/pre-commit-hooks

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
util_test.py 318 Bytes
一键复制 编辑 原始数据 按行查看 历史
Anthony Sottile 提交于 2020-02-06 03:10 +08:00 . pre-commit-hooks: python3.6+
import pytest
from pre_commit_hooks.util import CalledProcessError
from pre_commit_hooks.util import cmd_output
def test_raises_on_error():
with pytest.raises(CalledProcessError):
cmd_output('sh', '-c', 'exit 1')
def test_output():
ret = cmd_output('sh', '-c', 'echo hi')
assert ret == 'hi\n'
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ai-performance/pre-commit-hooks.git
git@gitee.com:ai-performance/pre-commit-hooks.git
ai-performance
pre-commit-hooks
pre-commit-hooks
master

搜索帮助