Make pycodestyle treat pytest.importorskip as an import statement (avoid E402)
Project description
flake8-pytest-importorskip
Description
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, so it may break in future versions of flake8 or pycodestyle.
Checks:
None
Installation
pip install flake8-pytest-importorskip
Usage
flake8 <your code>
For developers
Create venv and install deps
make init
Install git precommit hook
make precommit_install
Run linters, autoformat, tests etc.
make pretty lint test
Bump new version
make bump_major
make bump_minor
make bump_patch
License
Apache 2.0
Change Log
Unreleased
- ...
1.0.0 - 2021-02-19
- 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
File details
Details for the file flake8-pytest-importorskip-1.0.0.post0.tar.gz
.
File metadata
- Download URL: flake8-pytest-importorskip-1.0.0.post0.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.9.1 Linux/5.4.0-1039-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9316d625cd00544eecf99eb5100d37b7812bae1eb17a710eab92786888195e30 |
|
MD5 | d9a5791461e01dc8aa61097c0dc71d55 |
|
BLAKE2b-256 | cd6196263cb89425861e48ee691664511fbe148ca81aa44a471d6fd06a0646e5 |
File details
Details for the file flake8_pytest_importorskip-1.0.0.post0-py3-none-any.whl
.
File metadata
- Download URL: flake8_pytest_importorskip-1.0.0.post0-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.9.1 Linux/5.4.0-1039-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07c79d80463f6f2a6964f485904fe968b407f10f2ea03c683456791a8c7ec4fe |
|
MD5 | b36c4561a4a91f881d39cd2bb42d16ed |
|
BLAKE2b-256 | f86c045310716cc65b1e5f41f8ba2017ce3cea8353d47e8efcd6ff3079b48e55 |