Skip to main content

Pytest-Explicit

pypi version python versions package state pypi release pypi downloads license

Some tests you just don't want to run

Hey, I get it. Sometimes we write tests, but we don't actually want to wait for them to finish executing. Whether they're slow tests, they need some dependencies you don't have, or they aren't related to the work you do, there's some tests that just weren't meant to be run by devs in the age of CI/CD platforms. That's where pytest-explicit comes in.

This plugin allows developers to specify test markers that should be ignored by default when running pytest, but also quickly bypass this behaviour for CI/CD. Just add a --run-all flag to your pytest command for your test pipeline, and this plugin won't skip anything!

Configuring

If all you want to do is skip slow tests by default, you can stop reading now. Out-of-the-box, pytest-explicit will make any test marked slow require you to pass the --run-slow (or --run-all) for them to take up precious developer time.

Need more ignored tests? Just add the explicit-only option to your pytest config file, and pytest-explicit will pick up the markers specified and dynamically add --run-<marker> CLI options to pytest. Here's a sample setup.cfg file below!

[tool:pytest]
markers =
    slow: Marks a slow test
    memory_intensive: Marks a test that needs at least 16 gb RAM to run
    smoke: Marks a test that gives early alert to the health of the app
testpaths = tests
explicit-only =
    slow
    memory_intensive

With this configuration file, any test marked with either slow or memory_intensive won't run unless the appropriate CLI flags are passed!

Release files for pytest-explicit 1.0.1

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

Source distribution (sdist)

Source distribution for pytest-explicit 1.0.1
File Size Uploaded
pytest-explicit-1.0.1.tar.gz 4.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest-explicit 1.0.1
File Interpreter ABI Platform
pytest_explicit-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 8.7 kB

Release files / pytest-explicit-1.0.1.tar.gz

Download URL pytest-explicit-1.0.1.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d7ebc0335ce11cb34fc77212744996549cf35204cf739fb8fbc9be16e3d88ebf
BLAKE2b-256 checksum
How to use checksums
3e9fddd55b6318bc8867a746cb552709e40b80f1f6e67a2dcc3b9cd425834697
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

Release files / pytest_explicit-1.0.1-py3-none-any.whl

Download URL pytest_explicit-1.0.1-py3-none-any.whl
Size 4.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3e2279c1097c0379799bc2b99f9ff1fd12c36ca5b545a241e2ae2c48eda26344
BLAKE2b-256 checksum
How to use checksums
8c6d94fd71f72b8715d48fe3f6b91626ea41a18ea25daa163c270f0f511fbb1d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

0.1.1

2 release files

0.1.0

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