James Cooke
2018-09-12 21:32:11 UTC
Hi all,
If you're using something like the Arrange Act Assert pattern (AAA) /
Given When Then for writing your Python tests and Flake8 for linting
your code, then I'd be interested in your feedback on a Flake8 plugin
that I've been working on called flake8-aaa:
https://github.com/jamescooke/flake8-aaa
This plugin is in beta and currently checks four basic rules to help
break a test into three distinct blocks:
https://flake8-aaa.readthedocs.io/en/stable/rules.html and is based on
the description that I've put together for AAA here:
https://jamescooke.info/arrange-act-assert-pattern-for-python-developers.html
.
Some background: I wrote the plugin because I found that I was
slipping when following the AAA pattern and Adam (who some of you
might know https://github.com/adamchainz/) suggested that I write a
Flake8 plugin. It's currently kind of self-hosted (in that it tests
its own tests at test time), plus I'm using it happily at work and in
some open source projects.
Please let me know via email or GitHub issues if:
- You like the idea and want more!
- You have any tests that failed any of the current four checks, but
think they shouldn't have.- Conversely, you've found a test that passed, but you think it
shouldn't have.- This kind of thing is interesting, but you'd prefer a plugin
for pylint.- You've spotted that my plugin's code is terrible and how I should
improve it (PRs welcome ;) )- There's already something that does this / some other package that I
should be putting my efforts into.
Thanks for reading and happy testing!
James
If you're using something like the Arrange Act Assert pattern (AAA) /
Given When Then for writing your Python tests and Flake8 for linting
your code, then I'd be interested in your feedback on a Flake8 plugin
that I've been working on called flake8-aaa:
https://github.com/jamescooke/flake8-aaa
This plugin is in beta and currently checks four basic rules to help
break a test into three distinct blocks:
https://flake8-aaa.readthedocs.io/en/stable/rules.html and is based on
the description that I've put together for AAA here:
https://jamescooke.info/arrange-act-assert-pattern-for-python-developers.html
.
Some background: I wrote the plugin because I found that I was
slipping when following the AAA pattern and Adam (who some of you
might know https://github.com/adamchainz/) suggested that I write a
Flake8 plugin. It's currently kind of self-hosted (in that it tests
its own tests at test time), plus I'm using it happily at work and in
some open source projects.
Please let me know via email or GitHub issues if:
- You like the idea and want more!
- You have any tests that failed any of the current four checks, but
think they shouldn't have.- Conversely, you've found a test that passed, but you think it
shouldn't have.- This kind of thing is interesting, but you'd prefer a plugin
for pylint.- You've spotted that my plugin's code is terrible and how I should
improve it (PRs welcome ;) )- There's already something that does this / some other package that I
should be putting my efforts into.
Thanks for reading and happy testing!
James