Skip to content

Commit

Permalink
Merge pull request #30 from jamescooke/bump-v0.3.0
Browse files Browse the repository at this point in the history
Bump v0.3.0
  • Loading branch information
jamescooke committed Jun 28, 2018
2 parents fa0d4db + 6306f21 commit 6c90b1f
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 11 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ Versioning <http://semver.org/spec/v2.0.0.html>`_.
Unreleased_
-----------

0.3.0_ - 2018/06/28
-------------------

Added
-----

Expand Down Expand Up @@ -38,5 +41,6 @@ Fixed

Initial alpha release.

.. _Unreleased: https://github.com/jamescooke/flake8-aaa/compare/v0.2.0...HEAD
.. _Unreleased: https://github.com/jamescooke/flake8-aaa/compare/v0.3.0...HEAD
.. _0.3.0: https://github.com/jamescooke/flake8-aaa/compare/v0.2.0...v0.3.0
.. _0.2.0: https://github.com/jamescooke/flake8-aaa/compare/v0.1.0...v0.2.0
23 changes: 23 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,29 @@ Python tests against the rules of the `Arrange Act Assert pattern
<http://jamescooke.info/arrange-act-assert-pattern-for-python-developers.html>`_
of testing.


Installation
------------

Install with ``pip``::

$ pip install flake8-aaa

Check that ``flake8-aaa`` was installed correctly by asking ``flake8`` for its
version signature::

$ flake8 --version
3.5.0 (aaa: 0.3.0, mccabe: 0.6.1, pycodestyle: 2.3.1, pyflakes: 1.6.0) CPython 3.5.2 on Linux

The ``aaa: 0.3.0`` part of that output tells you ``flake8`` found this plugin.

There is more information on invoking ``flake8`` on the `Invoking Flake8
<http://flake8.pycqa.org/en/latest/user/invocation.html>`_ documentation page.

See the `full list of error codes on ReadTheDocs
<https://flake8-aaa.readthedocs.io/en/stable/rules.html>`_.


Resources
---------

Expand Down
32 changes: 25 additions & 7 deletions docs/rules.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Rules and error codes
=====================

The rules applied by ``flake8-aaa`` are from the `Arrange Act Assert pattern
for Python developers
<https://jamescooke.info/arrange-act-assert-pattern-for-python-developers.html>`_.

AAA01: no Act block found in test
---------------------------------

Expand Down Expand Up @@ -28,11 +32,10 @@ the Act block with ``# act`` (case insensitive)::
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.
There must be one and only one Act block in every test but ``flake8-aaa`` found
more than one potential Act block. This error is usually triggered when a test
contains more than one ``result =`` statement or more than one line marked ``#
act``. Multiple Act blocks create ambiguity and raise this error code.

Resolution
..........
Expand All @@ -44,8 +47,7 @@ AAA03: expected 1 blank line before Act block, found none
---------------------------------------------------------

For tests that have an Arrange block, there must be a blank line between the
Arrange and Act blocks. The linter could not find a blank line before the Act
block.
Arrange and Act blocks, but ``flake8-aaa`` could not find one.

This blank line creates separation between the arrangement and the action and
makes the Act block easy to spot.
Expand All @@ -58,3 +60,19 @@ Resolution
..........

Add a blank line before the Act block.

AAA04: expected 1 blank line before Assert block, found none
------------------------------------------------------------

For tests that have an Assert block, there must be a blank line between the Act
and Assert blocks, but ``flake8-aaa`` could not find one.

This blank line creates separation between the action and the assertions and
makes the Act block easy to spot.

As with rule ``AAA03``, this rule works best with ``E303`` enabled.

Resolution
..........

Add a blank line before the Assert block.
4 changes: 2 additions & 2 deletions flake8_aaa/__about__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

__short_name__ = 'aaa'
__name__ = 'flake8-{}'.format(__short_name__)
__version__ = '0.2.0'
__version__ = '0.3.0'

__author__ = 'James Cooke'
__copyright__ = '2018, {}'.format(__author__)

__description__ = 'Flake8 plugin that checks Pytest tests follow the Arrange Act Assert pattern'
__description__ = 'Extends Flake8 to check that tests follow the Arrange Act Assert pattern'
__email__ = 'github@jamescooke.info'
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def readme():
],
},
classifiers=[
'Development Status :: 3 - Alpha',
'Development Status :: 4 - Beta',
'Framework :: Flake8',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
Expand Down

0 comments on commit 6c90b1f

Please sign in to comment.