-
Notifications
You must be signed in to change notification settings - Fork 14
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
--order-group-scope for test which located in different folder #8
Comments
This is currently not possible. Order groups only work on module and class scope, not on directory scope. If you are ordering across modules (like in I think that your use case is a valid option, and I will see if I can add something later. Thanks for using the plugin :) |
- defines a scope based on directory depth, between session and module scope - closes pytest-dev#8
- defines a scope based on directory depth, between session and module scope - closes pytest-dev#8
- defines a scope based on directory depth, between session and module scope - closes pytest-dev#8
- defines a scope based on directory depth, between session and module scope - closes #8
…defines a scope based on directory depth, between session and module scope - closes #8
@veenone - I added a new option |
Hi @mrbean-bremen , Thanks for your response. I wasn't able to give you feedback on your first comment. I'll try this out once I'm back to my work. Does this option stackable with the other options? (order-group & order-group-scope)? As for the new option, how the value maps to the desired structure? |
As the new option also defines an order scope, it cannot be used together with |
@veenone - did you find time to test this? I will wait with a new release until I get some confirmation that it works as intended. |
@mrbean-bremen , I will try this out tomorrow and give you the feedback on the behavior |
Hi @mrbean-bremen , I have tested it but it seems it still not behaving as expected.
I execute with the following syntax : the behavior is that the test doesn't start from folder 01_feature_1, but getting the other ones, 03_feature_3:test_feature_c:test_id_01 something like that |
Ok, thanks - that is strange. You are calling pytest from the |
Actually I tried both calling from under src, and under test, which I know from the later one is not correct. Do you need the screenshot of the test execution? I think I will need to create a dummy name of them as the test information in a little bit confidential (company policy) , so I can't post it outside. |
If you could just try that minimal example that you posted, with empty tests (just with order markers), that would help. Something like the minimal example, with the respective output. |
Ok, I have tested it again, exactly with your layout described above, and it works both from |
Ah I found the difference actually. I have tried the minimal example and yes it works properly. and this is the test scripts for your reference |
That is strange. If I take your tests (minus the
As you can see, I used an enviroment with the same Python and pytest versions as you did, but it worked for me (I omitted the order group scope, as it doesn't make a difference in this case). The classes shouldn't make a difference, as they are only handled after the scope has been applied - so I'm still stumped... |
Actually if I use module scope for your example, it also works for me. In your case, pytest seems to collect the tests in another order from the beginning. Can you make one other test - remove pytest-order, and check how the tests are run in this case? Maybe I somehow rely on the usual order that tests are run (that shouldn't be the case, but I also have not tested this). I don't see any plugin you use that changes the standard order, but something has to be different... |
I also notice that you use a top-level |
Ok, while checking all plugins that are installed in your test, I found that |
hi @mrbean-bremen , thanks for your investigation. I have removed pytest-depends on my environment but it seems the behavior is the same : Additionally the top level of pytest.ini (at the same level with src) doesn't contain anything, it's just a template I made before.. |
Ok, thank you - can you also make the test without pytest-order, please, to check how the sorting would be without it? |
Thanks - I will have a look tonight! |
Hm - as far as I can see, you don't need to order the tests at all, they are already ordered as needed by default. I can see that your |
on the last condition, I don't have pytest-depends anymore. Thank you @mrbean-bremen ! |
Hi,
I would like to know whether it's possible to make orders for the following the structure :
\src
I'm executing all pytest from the \test level.
how to have the execution ordered by folder, then by the ordering number from each folder?
currently I'm using --order-scope=module --order-group-scope=class, but it seems the ordering is still not following the exact order number in 1 folder
The text was updated successfully, but these errors were encountered: