Skip to main content

Test-ordering plugin for pytest

Project description

A pytest plugin for ensuring tests within a class are run in source order.

Downloading

Release tarballs will be made available for download from Fedora Hosted:

https://fedorahosted.org/released/python-pytest-sourceorder/

The goal is to include this project in Fedora repositories. Until that happens, you can use testing builds from COPR – see “Developer links” below.

You can also install using pip:

https://pypi-hypernode.com/pypi/pytest-sourceorder

Usage

When installed, test classes marked @pytest_sourceorder.ordered will have tests tun in the order of their definition.

Methods are ordered by line nuber of their definition, so spreading them between multiple files or otherwise defining them outside of their class might cause the plugin to order them wrong.

When inheriting from an ordered test class, the superclass’ methods will be run first (even if overridden), followed by the ones from subclasses. You generally do not want to apply an additional @ordered decorator to the subclasses – doing so will reset the inheritance-based ordering.

Contributing

The project is happy to accept patches! Please format your contribution using the FreeIPA patch guidelines, and send it to <freeipa-devel@redhat.com>. Any development discussion is welcome there.

Someday the project might get its own list, but that seems premature now.

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-sourceorder-0.5.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

pytest_sourceorder-0.5-py2.py3-none-any.whl (5.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file pytest-sourceorder-0.5.tar.gz.

File metadata

File hashes

Hashes for pytest-sourceorder-0.5.tar.gz
Algorithm Hash digest
SHA256 9e141a10a16092230f24737bf7d3d6653fc059ea127a61b1e2d4fda61bcd4225
MD5 bba0069448110d8e7ce41ea45d91deb4
BLAKE2b-256 5b9ce48f623606aefce6ae71d80fc2e133d189f8c7ab68bbb649b8ef976cb5dd

See more details on using hashes here.

File details

Details for the file pytest_sourceorder-0.5-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_sourceorder-0.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 3be046fef3434400716290960ac09c093b56969213c2d795043a8172c07b3e97
MD5 fd16f8621a832c2d08ffdaef31a018fd
BLAKE2b-256 a8a50330c1ffe1ea59f630cfe7d44b81791b0ed98266ef4d1e2e5cf299d27a0b

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