用于python测试的linter
flake8-aaa的Python项目详细描述
薄片8 AAA
一种用于python测试的绒布。
一个flake8接口,自动将测试文件作为flake8的一部分 快跑。
用于自定义(非flake8)使用和调试的命令行界面。
测试是针对Arrange Act Assert pattern的。
tl;dr遵循aaa模式意味着测试如下:
def test(): """ __docstring__ """ <ARRANGE block> # set up of the system under test (SUT) <ACT block> # perform a single action on the SUT <ASSERT block> # check that the SUT changed as expected
你可能想看看at the examples。
兼容性
有关完整信息,请参见ReadTheDocs上的“兼容性列表”。
安装
使用pip:
安装$ pip install flake8-aaa
与flake8集成
假设您已经在同一环境中安装了flake8,请检查 flake8 aaa是通过询问flake8版本正确安装的 签名:
$ flake8 --version 3.7.8 (aaa: 0.7.0, mccabe: 0.6.1, pycodestyle: 2.5.0, pyflakes: 2.1.1) CPython 3.6.7 on Linux
输出的aaa: 0.7.0部分告诉您flake8找到了这个插件。现在 你可以像往常一样对你的项目运行flake8,flake8 aaa将运行lint 通过其插件进行测试:
$ flake8