Skip to content

ftobia/pytest-ordering

Folders and files

NameName
Last commit message
Last commit date

Latest commit

30df10b · Aug 25, 2021

History

62 Commits
Jun 14, 2019
Jun 14, 2019
Jun 14, 2019
Mar 17, 2014
Oct 25, 2018
Jun 14, 2019
Jun 14, 2019
Oct 25, 2018
Mar 17, 2014
Aug 25, 2021
Jun 14, 2019
Jun 14, 2019

Repository files navigation

pytest-ordering is no longer maintained, please use https://pypi.org/project/pytest-order/

pytest-ordering

pytest plugin to run your tests in a specific order

Build Status

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-ordering

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: ordering
collected 2 items

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

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

Check out the docs: http://pytest-ordering.readthedocs.org/

About

pytest plugin to run your tests in a specific order

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages