Skip to content
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

Example #6

Open
larsrinn opened this issue Mar 16, 2018 · 1 comment
Open

Example #6

larsrinn opened this issue Mar 16, 2018 · 1 comment

Comments

@larsrinn
Copy link

Do you have an example on how to use this?

@cybergrind
Copy link
Member

@larsrinn no readme for now, but you may check tests:
https://github.com/tipsi/pytest-tipsi-django/blob/master/test_django_plugin/app/tests/test_transactions.py

There are several pitfalls:

  • if you've changed module scoped model instance, you must wrap it in transaction and refresh_from_db upon test exit
  • if you want to perform model instance .delete - it's better not to do it on non-function scoped fixtures

In general, we're performing migration of our internal codebase and all major things seem working and we're happy with it.
But because of pytest design: no clean way to finish fixture, no guarantees about whether fixture will exist for your function or not for particular test and some other things - debugging seems harder.

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

2 participants