Skip to main content

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

Downloading

Release tarballs will be made available for download from Pagure Releases:

https://pagure.io/releases/python-pytest-sourceorder/

You can also install using pip:

https://pypi.python.org/pypi/pytest-sourceorder

The plugin is also available in Fedora repositories as python3-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 file any patches as Pull Requests on the project’s Pagure repo. Any development discussion should be in Pagure Pull Requests and Issues.

Changelog

v0.6 (2021-09-01)

  • Added support for decorated methods (thanks to Sergey Orlov)

v0.5.1 (2017-04-11)

Packaging improvements only

v0.5 (2016-01-26)

  • Added support for parametrized tests under Python 3

v0.4 (2015-01-26)

  • Python 3 compatibility

Metadata

Release files for pytest-sourceorder 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for pytest-sourceorder 0.6.0
File Interpreter ABI Platform Actions
pytest_sourceorder-0.6.0-py2.py3-none-any.whl Python 3, Python 2 none any Details for pytest_sourceorder-0.6.0-py2.py3-none-any.whl

Release files / pytest_sourceorder-0.6.0-py2.py3-none-any.whl

Download URL pytest_sourceorder-0.6.0-py2.py3-none-any.whl
Size 16.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
e48e052aaf66bb9e75ebf15fbdc91ee21d3b70f0a7736e2d397cd715a78e4ea2
BLAKE2b-256 checksum
How to use checksums
9fbdf8a72b7a5e0390d7b4e353744fabeaec50746cc74c5474ae90764a87a978
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.5.0.1 requests/2.25.1 setuptools/30.0.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

Security for pytest-sourceorder 0.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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