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

py.test ordering doesn't works when methods with order greater than 9 are present. #61

Open
PragyaCoder opened this issue Jan 27, 2020 · 1 comment

Comments

@PragyaCoder
Copy link

Hi,

I have a test class in which I have test methods ranging from @pytest.mark.run(order=1) .......to @pytest.mark.run(order=10). The 10th one always runs before the other tests. Please help!!

Regards,
Pragya

@PragyaCoder PragyaCoder changed the title py.test ordering doesn't works when double digit methods are present py.test ordering doesn't works when methods with order greater than 9 are present. Jan 27, 2020
@mondeja
Copy link

mondeja commented Jul 23, 2020

I can't reproduce it with pytest-ordering v0.6.0. Next test passes:

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

    @pytest.mark.run(order=1)
    def test_l(): pass

    @pytest.mark.run(order=2)
    def test_k(): pass

    @pytest.mark.run(order=3)
    def test_j(): pass
    
    @pytest.mark.run(order=4)
    def test_i(): pass

    @pytest.mark.run(order=5)
    def test_h(): pass

    @pytest.mark.run(order=6)
    def test_g(): pass
    
    @pytest.mark.run(order=7)
    def test_f(): pass

    @pytest.mark.run(order=8)
    def test_e(): pass

    @pytest.mark.run(order=9)
    def test_d(): pass
    
    @pytest.mark.run(order=10)
    def test_c(): pass

    @pytest.mark.run(order=11)
    def test_b(): pass

    @pytest.mark.run(order=12)
    def test_a(): pass
    """

    assert item_names_for(tests_content) == ['test_%s' % i for i in 'lkjihgfedcba']

Can you provide more details about Python and pytest-ordering versions 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