Treat pytest.importorskip
as an import statement, not code, to silence the "module level import not at top of file" (E402) from pycodestyle
It allows code such as this to pass without having to globally disable E402.
It does this in a slightly hacky way (see the docs of kgb for details) , so it may break in future versions of pycodestyle.
None
pip install flake8-pytest-importorskip
flake8 <your code>
make init
make precommit_install
make pretty lint test
make bump_major
make bump_minor
make bump_patch
Apache 2.0
- Replace accing private state of flake8 plugins with wrapping/spying on function, using kgb
- initial