Skip to content

order will work between diffrent testClass #53

@lockeCucumber

Description

@lockeCucumber

python 3.7.1
pytest 4.4.0
pytest-ordering 0.6

there are two testClass, and I find the test will run as order which I set.

import unittest
import pytest
class TestA(unittest.TestCase):
    @pytest.mark.run(order=0)
    def test_0(self):
        pass 

    @pytest.mark.run(order=2)
    def test_2(self):
        pass 
    ...  #other test_method

class TestB(unittest.TestCase):
    @pytest.mark.run(order=1)
    def test_1(self):
        pass 
    ...  #other test_method

run the code, I find the tests run as test_0-->test_1-->test_2.

But, I want to the tests run all test_method in a TestClass and then run another TestClass.
like test_0-->test_2-->test_1, or test_1-->test_0-->test_2.

any way, the design of now is cool。
I think add a param to control the run order only work in a TestClass will be better.
Because the TestA 's setUpClass will run again after run test_1,if setUpClass is time long,will be bad feel.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions