Flake8 plugin to disallow the use of the pytest.mark.only decorator.
Project description
flake8-no-pytest-mark-only
A Flake8 plugin to check for the usage of the @pytest.mark.only decorator.
Rationale
The @pytest.mark.only decorator, coming from the pytest-only plugin, is great.
It's super useful when developing your tests, so that you can run just the test (or set of tests) that you're working on,
without having to run your whole test suite.
The only problem with it is that when you forget to remove it after you've finished developing your tests, and you accidentally commit it to your repository, it's hard to notice that only a subset of tests are running in CI instead of the whole test suite.
This Flake8 plugin prevents that, by raising a lint error on usages of the @pytest.mark.only decorator,
so that you notice that you've committed changes with the decorator in them.
Usage
Just install the flake8-no-pytest-mark-only package, and when you run Flake8,
it will automatically find the plugin and use it.
If you want to override the reporting from this plugin, you can filter for the error code PNO001:
# Turn on the errors from this plugin
flake8 --select PNO001 ...
# Turn off the errors from this plugin
flake8 --extend-ignore PNO001 ...
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flake8-no-pytest-mark-only-1.0.0.tar.gz.
File metadata
- Download URL: flake8-no-pytest-mark-only-1.0.0.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf295fb4198ee7d30e86711aa36e56231a0660425482255fc4818b2fabe2c77b
|
|
| MD5 |
f740b085ec05a8dab48283cf2da0e203
|
|
| BLAKE2b-256 |
6d2a4eca25a4271af5e9770d5cf836b42a26e29ce9c687c90f4f08fd7b02f292
|
File details
Details for the file flake8_no_pytest_mark_only-1.0.0-py3-none-any.whl.
File metadata
- Download URL: flake8_no_pytest_mark_only-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dcbc6aff2f3a8d63cd9a16c7232351143f90fa04f0956673bc0f5c51528ffbb7
|
|
| MD5 |
f72258b43ae5aba746f234ce549bc652
|
|
| BLAKE2b-256 |
b843af2c5ae6c6443483156db1bd6d7db2e81af84b1f3060c4667592fe09bf08
|