pytest plugin to run your tests in a specific order
Project description
pytest-order
This is a fork of pytest-ordering.
That project is not maintained anymore, and there are several helpful PRs
waiting for merge. Therefore I decided to create this fork that tries to
combine the original code with most of the provided PRs.
My hope is that the original project will be moved to the pytest
organization as outlined in
this issue. When this
happens, this fork will be obsolete.
pytest-order is a pytest plugin to run your tests in a specific order.
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 some pytest markers that you can use in your code.
For example, this:
import pytest
@pytest.mark.run(order=2)
def test_foo():
assert True
@pytest.mark.run(order=1)
def test_bar():
assert True
Yields this output:
$ py.test test_foo.py -vv
============================= test session starts ==============================
platform darwin -- Python 2.7.5 -- py-1.4.20 -- pytest-2.5.2 -- 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 ===========================
More information can be found in the documentation:
- for the latest release
- for the current master
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pytest_order-0.7.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c40ab80c17efe4fbcde44845c72d807c2dd56ca5b87bd7a0d3b53cec96e4475 |
|
MD5 | 011e0a6a93c7d61cf2750adf7b3e0254 |
|
BLAKE2b-256 | 41a9ded1f75e6b6e8aa8019b10bb3f0d99a79add4ccce9325b8ad8ad81b29f74 |