Skip to main content

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 ...

Metadata

Release files for flake8-no-pytest-mark-only 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flake8-no-pytest-mark-only 1.0.0
File Size Uploaded
flake8-no-pytest-mark-only-1.0.0.tar.gz 4.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for flake8-no-pytest-mark-only 1.0.0
File Interpreter ABI Platform
flake8_no_pytest_mark_only-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.0 kB

Release files / flake8-no-pytest-mark-only-1.0.0.tar.gz

Download URL flake8-no-pytest-mark-only-1.0.0.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
cf295fb4198ee7d30e86711aa36e56231a0660425482255fc4818b2fabe2c77b
BLAKE2b-256 checksum
How to use checksums
6d2a4eca25a4271af5e9770d5cf836b42a26e29ce9c687c90f4f08fd7b02f292
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.5

Release files / flake8_no_pytest_mark_only-1.0.0-py3-none-any.whl

Download URL flake8_no_pytest_mark_only-1.0.0-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dcbc6aff2f3a8d63cd9a16c7232351143f90fa04f0956673bc0f5c51528ffbb7
BLAKE2b-256 checksum
How to use checksums
b843af2c5ae6c6443483156db1bd6d7db2e81af84b1f3060c4667592fe09bf08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.5

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page