Skip to main content
PyPI version Python versions See Build Status on Travis CI See Build Status on AppVeyor

pytest-involve is a pytest plugin for running only tests which cover a given file or set of files. It’s called pytest-involve because it lets you run only tests involving modules or members from those modules.

Usually with pytest the test set to run is specified and coverage collected based on that set. When pytest-involve is used, instead you specify the file(s) you want to cover, and test files are selected based on whether they import from those file(s) or not.

Usages

pytest-involve adds one command line argument to pytest, namely --involving. This can be provided a file path, a module import path (such as you would use in a Python interpreter), or either of the above suffixed with :: and the name of something defined in there:

pytest --involving ./path/to/file.py

pytest --involving importable.module.path

pytest --involving ./path/to/file.py::member

pytest --involving importable.module.path::member

This will have the effect of only collecting and running tests which are defined in modules whose imports overlap with the file(s) and member(s) specified with the --involving flag.

The plugin aims for recall over precision: It might run a few tests that aren’t strictly necessary, but it shouldn’t ignore any tests that are.

The ::member syntax will only work for things with a __file__ attribute (so, mostly classes and functions).

pytest-involve should play nicely with most other pytest plugins.


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

Features

  • Run unit tests covering specific file(s) via the command line flag --involving

Requirements

  • pytest

  • That’s it.

Installation

You can install “pytest-involve” via pip from PyPI:

$ pip install pytest-involve

Contributing

Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.

License

Distributed under the terms of the MIT license, “pytest-involve” is free and open source software.

Issues

If you encounter any problems, please file an issue along with a detailed description.

Download files

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

Source Distribution

pytest-involve-0.1.1.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

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

pytest_involve-0.1.1-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file pytest-involve-0.1.1.tar.gz.

File metadata

  • Download URL: pytest-involve-0.1.1.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.2

File hashes

Hashes for pytest-involve-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9dea50b650dc03b3d6b945f3870b4209932eadb2aa44b8c8b0cd88d58383103a
MD5 a3267eaca60a323fa8271e99819a4fe3
BLAKE2b-256 8e368096b2e52f743efc9d74865c1a8ee622dd761f84415dacbed8b0c13b3e1a

See more details on using hashes here.

File details

Details for the file pytest_involve-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pytest_involve-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.2

File hashes

Hashes for pytest_involve-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 03edfd4d3a89f890313a834b974a7e3227eb2c842ef62edaf4db712dc64725f5
MD5 afe6f6c7c135bb779546d42b5470072b
BLAKE2b-256 1139517b07d3e8593d01f4dd090fcee08bbee6c38ff030165ab5621600b230b4

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

This release

0.1.1 This release

2 files

0.1.0

2 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