Skip to content

Prioritizing pytests --first flags over Django's "usual" test order breaks mix of TestCase und TransactionTestCase with data migrations #940

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

Open
dfn-certling opened this issue Jul 13, 2021 · 0 comments

Comments

@dfn-certling
Copy link

dfn-certling commented Jul 13, 2021

This was introduced in #819. If I have data migrations in my project and two test cases, one TestCase and one TransactionTestCase, prioritizing the first flags over the order introduced in #214 can break the TestCase.

Running tests with --new-first and modifying the TransactionTestCase after the TestCase results in an empty database for the latter. If the project uses data migrations to create default data in the database this breaks the TestCase relying on that data. Running tests with --failed-first does the same if the TransactionTestCase is the last to have failed.

This means for a project using data migrations in this way and having both TestCases and TransactionTestCases the first flags cannot be used reliably currently.

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

1 participant