ftobia / pytest-ordering

pytest plugin to run your tests in a specific order
MIT License
233 stars 41 forks source link

Ordering with multiple files #25

Open naggappan opened 8 years ago

naggappan commented 8 years ago

Use case:

It becomes very difficutl when we have more than 100 test case , If any one test case is added in single file we need to change the order number in all test case files. More info in "http://stackoverflow.com/questions/35909656/pytest-ordered-plugin-doesnt-work-with-combination-of-multiple-files"

Formartha commented 6 years ago

Hi @naggappan, Did you managed to work it out? we have the same exact issue we are trying to solve. I don't mind switching tools - I just need it to work :)

naggappan commented 6 years ago

@Formartha no it did not worked in that way. So we made our test cases not dependent . setup class then do the test for that particular class and then tear down class thats it. more number of test case py files but that solved the issue

chrisyang0604 commented 4 years ago

I have the same issue.....Have a lot of test cases, add sequence for them, if add new one between, have to update all sequence which after new added test case.

fenchu commented 4 years ago

Have same issue, the workaround is to list all files on the commandline in the order they should run and drop the sequence althogether.

mrbean-bremen commented 4 years ago

In case that helps someone: I added a command line option to set the order scope in my fork - by using --order-scope=module you will get the needed behavior (e.g. ordering is done per module).

shakthifuture commented 3 years ago

this link help me to resolve this issue https://stackoverflow.com/questions/35909656/pytest-ordered-plugin-doesnt-work-with-combination-of-multiple-files/67395190#67395190

mrbean-bremen commented 3 years ago

@shakthifuture - that answer uses the forked pytest-order which I mentioned in my comment above - it does not resolve the problem for pytest-ordering. If you use that fork, you also have to change your order markers (for example from pytest.mark.run(order=2) to pytest.mark.order(2)).