Skip to main content

Expand command-line shortcuts listed in pytest configuration

Project description

pytest-shortcuts

Expand command-line shortcuts listed in pytest configuration

This pytest plugin was generated with Cookiecutter along with @hackebrot's cookiecutter-pytest-plugin template.

Getting Started

Install using your favourite python package manager:

$ pip install pytest-shortcuts

Add some shortcuts to your pytest configuration:

[pytest]
shortcuts =
    --live: -m "live and not slow"
    --slow: -m "live and slow"
    --offline: --disable-socket -m "not live"

Now when you run your tests with eg --live, it will be as if you provided -m "live and not slow".

Bonus: including dotenv files

For each shortcut, you can also define a dotenv file to load with custom configuration:

[pytest]
shortcuts =
    --live: -m "live and not slow" --envfile=.live.env
    --slow: -m "live and slow"

Note that this dotenv file loads the environment very early, but any pytest-plugins will have already been imported by then. Any plugin that relies on an environment variable during module import (and not eg at runtime) may not see values loaded from this file.

License

Distributed under the terms of the BSD-3 license, "pytest-shortcuts" is free and open source software

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-shortcuts-0.2.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytest_shortcuts-0.2.0-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file pytest-shortcuts-0.2.0.tar.gz.

File metadata

  • Download URL: pytest-shortcuts-0.2.0.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5

File hashes

Hashes for pytest-shortcuts-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7d9ff81d65f7278b67fb0262f46c0868a3d3b14ebd17826f65b218c4e09346fd
MD5 99290826ae6dcef8e9527a4fe526ba81
BLAKE2b-256 d465fb43b6419cb50b47268b28fd869705ac493676e9820f27390113afbe8b45

See more details on using hashes here.

File details

Details for the file pytest_shortcuts-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pytest_shortcuts-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5

File hashes

Hashes for pytest_shortcuts-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 44c5278c6ed615c820c84bb14af86452745793cf3035c562c4b1e5b98a4c063d
MD5 6b227e18e32636f55eb710789d966336
BLAKE2b-256 bf0d0d2e65a877a2e2b294725f0fd38e189c0ed1450d7646be8e6e1eb995921b

See more details on using hashes here.

Supported by

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