skip to navigation
skip to content

pytest-sourceorder 0.5

Test-ordering plugin for pytest

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


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

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:


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.


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

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

File Type Py Version Uploaded on Size
pytest-sourceorder-0.5.tar.gz (md5) Source 2016-01-26 3KB
pytest_sourceorder-0.5-py2.py3-none-any.whl (md5) Python Wheel 2.7 2016-01-26 5KB