Skip to main content
Travis build

flake8-aaa plugin

A flake8 plugin for linting Python tests against the rules of the Arrange Act Assert pattern of testing.

Resources

Docs

(to be extracted to RTD)

Test discovery

  • Filename must start with test_ and have been collected for linting by flake8.

  • Test must be a function where its name starts with test.

  • Tests that contain only comments, docstrings or pass are skipped.

Error codes

AAA01: no Act block found in test

Test found to have no Act block.

An Act block is usually a line like result = or a check that an exception is raised using with pytest.raises(Exception):.

Resolution

Add an Act block to the test or mark a line that should be considered the action.

Even if the result of a test action is None, assign that result and test it:

result = action()

assert result is None

If you can’t set a result, then mark the end of the line considered the Act block with # act (case insensitive):

data['new_key'] = 1  # act

AAA02: multiple Act blocks found in test

There must be one and only one Act block in every test. The linter found more than one potential Act block in this test.

A test that contains more than one result = statement or more than one line marked # act creates ambiguity and raises this error code.

Resolution

Splitting the failing test into multiple tests. Where there is complicated or reused set-up code then that should be extracted into fixtures.

Metadata

Release files for flake8-aaa 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flake8-aaa 0.1.0
File Size Uploaded Provenance Actions
flake8-aaa-0.1.0.tar.gz 5.8 kB Without provenance Details for flake8-aaa-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for flake8-aaa 0.1.0
File Interpreter ABI Platform Actions
flake8_aaa-0.1.0-py3-none-any.whl Python 3 none any Details for flake8_aaa-0.1.0-py3-none-any.whl

Total release size: 14.3 kB

Release files / flake8-aaa-0.1.0.tar.gz

Download URL flake8-aaa-0.1.0.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
5553563d0f61f6d8d3bd971cafc259df24f9adb6cfd808d2ab880af2b16b2ac1
BLAKE2b-256 checksum
How to use checksums
a28f42d91ca42fd5a3e5e0ba00aee2f3514c6f3b19ee272e03f776d0e7c6c4d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / flake8_aaa-0.1.0-py3-none-any.whl

Download URL flake8_aaa-0.1.0-py3-none-any.whl
Size 8.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ed327e389280ea8af90c6458929729f69013b58c54538dac988625e7187f61a7
BLAKE2b-256 checksum
How to use checksums
45ba9fa681757dfb0f2c65a01fad88da700d9428af15adbdcead12800f1cafad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for flake8-aaa 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page