-
Notifications
You must be signed in to change notification settings - Fork 347
Unexpected test order when mixing pytest / unittest tests and transactional tests #827
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
Comments
Does #820 (in master) fix it? |
Anyway, it might also just not work as expected. pytest-django/pytest_django/plugin.py Lines 419 to 440 in c65dc70
(I've not investigated/looked closer at your report yet) It likely needs to look at classes also then? |
I'll look at #820 👍 About the code yes, that's what I've been looking at, and yes it should look at classes if we want to change the behaviour :> Thank you for your quick answers :) |
#820 is going to make it so my custom ordering is applied after so yes, it should fix my current issue. I could also apply I still think pytest-django's behaviour could be improved, I'll keep digging for now :) |
Let's say I have the following tests:
I expect transactional tests, here
test_function_with_transactional_db
andMyTransactionTestCase.test_method
to run last.Running pytest yields:
I tried fixing this by adding a
pytest_collection_modifyitems
in my project but my custom ordering runs before pytest-django's ordering. So pytest-django gets the last word, and in this case it's not what I want :>I think this can be fixed by improving on what's being done in
pytest_collection_modifyitems
, I'll try something out and hopefully open a PR.The text was updated successfully, but these errors were encountered: