Skip to main content

A pytest plugin that runs marked tests when files change.

Project description

pytest-filemarker

A pytest plugin that runs marked tests when files change.

Usage

Files should have a PYTEST_MARKS variable containing a list of marked tests to run when the files change.

PYTEST_MARKS = ['markone', 'marktwo']

class MyClass:
    ...

When this file has changed, any tests with marks markone or marktwo will be run.

To invoke the plugin, run:

pytest --filemarker-active

By default, the plugin will use git to look at the changes between HEAD and HEAD~1 to generate a list of files to inspect. To override this, use the --filemarker-files parameter:

pytest --filemarker-files='<file1> <file2>'

Options

filemarker:
  --filemarker-active   Should the plugin be active? Automatically set to True
                        if other options are specified.
  --filemarker-files='file1 file2...'
                        Files to search. If not supplied will look at the latest
                        changes from git.
  --filemarker-variable=VARIABLE
                        Variable which contains a list of marks. Defaults to
                        PYTEST_MARKS

filemarker-variable can also be set wherever you configure pytest (e.g. pytest.ini).

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-filemarker-0.1.0.dev4.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

pytest_filemarker-0.1.0.dev4-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file pytest-filemarker-0.1.0.dev4.tar.gz.

File metadata

  • Download URL: pytest-filemarker-0.1.0.dev4.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.9.0

File hashes

Hashes for pytest-filemarker-0.1.0.dev4.tar.gz
Algorithm Hash digest
SHA256 88744cbd0b84c281a885978fd4f7a3ce395b239cc96ed5c8e2925df82f09fcb7
MD5 9e9fbdaa08e1af5db7273b42b16d5aa3
BLAKE2b-256 1c496e970323a98ce99e4e8e5582fb06135754f90b60b54009d6f01185ccf145

See more details on using hashes here.

File details

Details for the file pytest_filemarker-0.1.0.dev4-py3-none-any.whl.

File metadata

  • Download URL: pytest_filemarker-0.1.0.dev4-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.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.9.0

File hashes

Hashes for pytest_filemarker-0.1.0.dev4-py3-none-any.whl
Algorithm Hash digest
SHA256 2db238a23f173950f7b2b5e4a6d8fad24d84eb12b723fae7cd9075eed7013a81
MD5 cff4803a9e723f2702ad2b98e5bb5084
BLAKE2b-256 0b7f43d3b694c64ac94897c01b9ccd87a53928faa14183357b9b1609ca1c0419

See more details on using hashes here.

Supported by

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