A linter for Python tests
Project description
Flake8-AAA
A linter for Python tests.
A Flake8 interface to automatically lint test files as part of your Flake8 run.
A command line interface for custom (non-Flake8) usage and debugging.
Tests are linted against the Arrange Act Assert pattern.
TL;DR following the AAA pattern means tests look like this:
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
You might want to take a look at the examples.
Compatibility
Pytest and unittest styles of testing supported.
Compatible with Black formatted code.
Tested on latest three versions of Python: 3.5, 3.6 and 3.7.
See the “Compatibility list” on ReadTheDocs for full info.
Installation
Install with pip:
$ pip install flake8-aaa
Integration with Flake8
Given that you already have Flake8 installed in the same environment, check that Flake8-AAA was installed correctly by asking flake8 for its version signature:
$ 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
The aaa: 0.7.0 part of that output tells you Flake8 found this plugin. Now you can run flake8 as usual against your project and Flake8-AAA will lint your tests via its plugin:
$ flake8
Resources
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for flake8_aaa-0.7.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f4f38b2888f004b5cbc79b96c6354e68a542e2a370be10e5c7a596ad77f15dd |
|
MD5 | e3e13d4681172a0de3d321d7474579dd |
|
BLAKE2b-256 | 31882932a6595e10c0ba22e02b5e3402ee432c97349ccc521cdfe414f7d37f16 |