No project description provided
Project description
flake8-pytest-style
Description
A flake8
plugin checking common style issues or inconsistencies with pytest
-based tests.
Currently the following errors are reported:
-
PT001 use @pytest.fixture() over @pytest.fixture
-
PT002 configuration for fixture '{name}' specified via positional args, use kwargs
e.g.@pytest.fixture(scope='module')
is OK, and@pytest.fixture('module')
is an error -
PT003 scope='function' is implied in @pytest.fixture()
e.g.@pytest.fixture(scope='function')
should be replaced with@pytest.fixture()
-
PT004 fixture '{name}' does not return anything, add leading underscore
-
PT005 fixture '{name}' returns a value, remove leading underscore
-
PT006 wrong name(s) type in @pytest.mark.parametrize, expected {expected_type}
e.g.@pytest.mark.parametrize(('name1', 'name2'), ...)
is ok, and@pytest.mark.parametrize('name1,name2', ...)
is an error -
PT007 wrong values type in @pytest.mark.parametrize, expected {expected_type}
-
PT008 use return_value= instead of patching with lambda
e.g.mocker.patch('target', return_value=7)
is OK, andmocker.patch('target', lambda *args: 7)
is an error
Installation
pip install flake8-pytest-style
For developers
Install deps and setup pre-commit hook
make init
Run linters, autoformat, tests etc.
make format lint test
Bump new version
make bump_major
make bump_minor
make bump_patch
License
MIT
Change Log
0.1.0 - 2019-05-23
- initial
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-pytest-style-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e3fb366db8e6be68d5cbdb1817b0d33952820ead5d18394da9f77db2400de8c |
|
MD5 | df7a93dbef02d3a537110d7e4f5b9a13 |
|
BLAKE2b-256 | 95b4e3d4bb4cf2a1a1bfbd9a93e8436659c448643721e6b178237d7ef1fec592 |
Hashes for flake8_pytest_style-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8717a566217b59d8c5373b485e1a3d30ffa7c8900fb3464cdfc787e783ecb61 |
|
MD5 | eb7aeaa07cf595bdca8b6cbb7876f35e |
|
BLAKE2b-256 | a96b32963c2f6d1b6388ffb410942aaaf885006075d73e61f354f048a866248f |