Skip to main content

A pytest plugin that runs marked tests when files change.

Project description


A pytest plugin that runs marked tests when files change.


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>'


  --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.
                        Variable which contains a list of marks. Defaults to

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.dev1.tar.gz (3.7 kB view hashes)

Uploaded Source

Built Distribution

pytest_filemarker-0.1.0.dev1-py3-none-any.whl (4.5 kB view hashes)

Uploaded Python 3

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