Skip to main content

pytest-order - a pytest plugin to order test execution

PyPI version Build Status Coverage Status Python version

pytest-order is a pytest plugin that allows you to customize the order in which your tests are run. It uses the marker order that defines when a specific test shall be run relative to the other tests.

Documentation

Apart from this overview, the following information is available:

History

This is a fork of pytest-ordering. That project is not maintained anymore, and there are several helpful PRs that are now integrated into pytest-order. The idea and most of the code has been created by Frank Tobia, the author of that plugin. In case pytest-ordering is revived, this project will be obsolete.

Compatibility to pytest_ordering

pytest-order is not compatible with pytest-ordering due to the changed marker name (order instead of run). Only the order marker is supported, support for all additional markers has been removed for consistence (see this issue).

Overview

(from the original project)

Have you ever wanted to easily run one of your tests before any others run? Or run some tests last? Or run this one test before that other test? Or make sure that this group of tests runs after this other group of tests?

Now you can.

Install with:

pip install pytest-order

This defines the order marker that you can use in your code with different attributes.

For example, this code:

import pytest

@pytest.mark.run(order=2)
def test_foo():
    assert True

@pytest.mark.run(order=1)
def test_bar():
    assert True

yields the output:

$ py.test test_foo.py -vv
============================= test session starts ==============================
platform darwin -- Python 3.7.1, pytest-5.4.3, py-1.8.1, pluggy-0.13.1 -- env/bin/python
plugins: order
collected 2 items

test_foo.py:7: test_bar PASSED
test_foo.py:3: test_foo PASSED

=========================== 2 passed in 0.01 seconds ===========================

Release files for pytest-order 0.8.0

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

Source distribution (sdist)

Source distribution for pytest-order 0.8.0
File Size Uploaded Provenance Actions
pytest-order-0.8.0.tar.gz 6.5 kB Without provenance Details for pytest-order-0.8.0.tar.gz

Built distribution (wheel)

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

Total release size: 12.9 kB

Release files / pytest-order-0.8.0.tar.gz

Download URL pytest-order-0.8.0.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
8fc5a91d6ae39b576a43beaaf07ef8cca2c2f6a2390a254769544f59109508c4
BLAKE2b-256 checksum
How to use checksums
b3c3c14b63aa67e41e463b988b383e46e8402f5632db84d5cc2dc3685e7088ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/50.3.2 requests-toolbelt/0.8.0 tqdm/4.46.1 CPython/3.7.1

Release files / pytest_order-0.8.0-py2.py3-none-any.whl

Download URL pytest_order-0.8.0-py2.py3-none-any.whl
Size 6.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
8070f5d4fcfe1e7bdff86fdb13c9d7780a9e130d615a64a23f04c5d84950a219
BLAKE2b-256 checksum
How to use checksums
2225316afaf7a9d7f8b7e20a38bd47ef3eb8ca8f2c5ad60e7caa96e53fe5646f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/50.3.2 requests-toolbelt/0.8.0 tqdm/4.46.1 CPython/3.7.1

Security for pytest-order 0.8.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