Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pytest ordering excecute in reverse order #64

Open
shubhamdhole2494 opened this issue May 28, 2020 · 1 comment
Open

pytest ordering excecute in reverse order #64

shubhamdhole2494 opened this issue May 28, 2020 · 1 comment

Comments

@shubhamdhole2494
Copy link

shubhamdhole2494 commented May 28, 2020

import pytest

@pytest.mark.run(order=1)
def testA():
    print("Method A")

@pytest.mark.run(order=2)
def testB():
    print("Method B")

@pytest.mark.run(order=3)
def testC():
    print("Method C")

Output :
collected 3 items

pytest_basics.py::testC Method C
PASSED
pytest_basics.py::testB Method B
PASSED
pytest_basics.py::testA Method A
PASSED

@mondeja
Copy link

mondeja commented Jul 23, 2020

I can't reproduce it with latest 0.6.0 version, next test passes:

def test_a(item_names_for):
    tests_content = """
    import pytest

    @pytest.mark.run(order=1)
    def testA():
        print("Method A")

    @pytest.mark.run(order=2)
    def testB():
        print("Method B")

    @pytest.mark.run(order=3)
    def testC():
        print("Method C")
"""
    assert item_names_for(tests_content) == ['testA', 'testB', 'testC']

Can you provide more details like the versions of pytest-orderingand Python used?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants