Skip to main content

A Pytest plugin to ignore certain marked tests by default

Project description

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!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest-explicit-1.0.1.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

pytest_explicit-1.0.1-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file pytest-explicit-1.0.1.tar.gz.

File metadata

  • Download URL: pytest-explicit-1.0.1.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for pytest-explicit-1.0.1.tar.gz
Algorithm Hash digest
SHA256 d7ebc0335ce11cb34fc77212744996549cf35204cf739fb8fbc9be16e3d88ebf
MD5 4ae517f27a29dd585f13136ebc725276
BLAKE2b-256 3e9fddd55b6318bc8867a746cb552709e40b80f1f6e67a2dcc3b9cd425834697

See more details on using hashes here.

File details

Details for the file pytest_explicit-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: pytest_explicit-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for pytest_explicit-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3e2279c1097c0379799bc2b99f9ff1fd12c36ca5b545a241e2ae2c48eda26344
MD5 933a14b3bb0c6e2f87a795fb255425f8
BLAKE2b-256 8c6d94fd71f72b8715d48fe3f6b91626ea41a18ea25daa163c270f0f511fbb1d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page