Skip to main content

A pytest plugin to collect tests based on fixtures being used by tests

Project description

PyPI version Python versions See Build Status on AppVeyor

A pytest plugin to collect tests based on fixtures being used in tests


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

Features

  • Filter tests collection/execution based on fixtures being used by tests

  • One or more number(comma separated) of fixtures are supported with option –uses-fixtures

One can combine fixture based collection with pytests default options/plugins for further smart collection.

Requirements

  • Python >= 3.9

  • Pytest >= 3.5

Installation

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

$ pip install pytest-fixturecollection

Usage

Once plugin is installed, run pytest command with “–uses-fixtures” option as shown below:

# pytest --uses-fixtures fixture1,fixture2 tests/

Explanation: All the tests using fixture1 or fixture2 inside tests directory would be collected and executed and rest tests would be uncollected (not executed). You can also choose to just –collect-only to view what tests are collected.

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 BSD-3 license, “pytest-fixturecollection” is free and open source software

Issues

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

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-fixturecollection-0.1.1.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

File details

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

File metadata

File hashes

Hashes for pytest-fixturecollection-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b4636d7410472b2b9b6e6d7a42818561640bf59df4a15d91f6339e9571662460
MD5 9bfbd860865b790f4679d07f82cc374e
BLAKE2b-256 a54a6e7f5ec62e5a29e31e7a9b4b5dc15f9310497814a5f4ad40f36e8c6892e9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pytest_fixturecollection-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 88368e724cadf01ab4f5b05b66edef763db4a4e88d9926ac0974b12dccdff236
MD5 77ac2aeba6bd1d92f830d07b5dd69fc1
BLAKE2b-256 7d6bb5bce24c4f9756d87ee157e45d53002cbcc9fdbbae65e02cffc11c1524b4

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