A linter for Python tests
Project description
Flake8-AAA
A linter for Python tests.
Pytest and unittest styles supported.
Tests are linted against the Arrange Act Assert pattern.
TL;DR following the AAA pattern means tests look like this:
def test(): """ __docstring__ """ # ARRANGE: set up of the system under test (SUT) # ACT: perform a single action on the SUT # ASSERT: check that the SUT changed as expected
Provides a Flake8 interface to automatically lint test files as part of your Flake8 run.
Provides a command line interface for custom (non-Flake8) usage and debugging.
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.7 (aaa: 0.6.0, mccabe: 0.6.1, pycodestyle: 2.5.0, pyflakes: 2.1.1) CPython 3.6.7 on Linux
The aaa: 0.6.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
Tested on Pythons 3.5, 3.6 and 3.7.
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.6.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57e5a3eaa30c55032f740213f5e81519dcf5576a13981f50a9ab29584f769181 |
|
MD5 | b0f7ebaaf5293f6ddfe0decb4bc8a2ee |
|
BLAKE2b-256 | 3ca0e558e1d197f1aebfc89a5f5b1f07a05fd2e66078cec9f9dbf9ceb032d3a4 |