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

Remaining tests fail when assertion fails #7004

Closed
2 of 4 tasks
gsilvapt opened this issue Apr 2, 2020 · 3 comments
Closed
2 of 4 tasks

Remaining tests fail when assertion fails #7004

gsilvapt opened this issue Apr 2, 2020 · 3 comments

Comments

@gsilvapt
Copy link

gsilvapt commented Apr 2, 2020

Hi!

I have a Django application that has many tests and we moved onto pytest recently.
Everything was fine until we needed to reset a virtual environment and we realized all remaining tests were failing with TransactionManagementError after one assertion failed. Previously, it would just point one failing test, the one with a failing assertion. All others would run without any transaction errors.

To test this, I fresh installed our env, without pin-pointing pytest's version and it installs version 5.4.1.
Then I modified a working test so that it fails, and got many failing tests, one with the assertion and all others with TransactionManagementError.
Than ran pip install pytest=5.3.5. manually, ran the suite again, and only one test was failing - the one with the wrong assertion.

I can't show code, nor the tests, nor the environment because this is still a closed-source application and I don't want to get into legal issues, but thought it might be important to talk with you guys about this as this seems like a bug introduced in the march's releases.

Environment that I am allowed to share:
pytest 5.3.5 - which works
pytest 5.4.1 - which doesn't work
pytest-django 3.8.0
MacOS Mojave 10.14.6
Python 3.7.5
Django 2.1.15

  • a detailed description of the bug or suggestion
  • output of pip list from the virtual environment you are using
  • pytest and operating system versions
  • minimal example if possible
@RonnyPfannschmidt
Copy link
Member

I suspect this is related to the know bug /regression about not running unit test teardown, i can't crosslink while on mobile

@gsilvapt
Copy link
Author

gsilvapt commented Apr 2, 2020

Maybe this? I couldn't find official release to see for known bugs: #6752

@blueyed
Copy link
Contributor

blueyed commented Apr 2, 2020

Please upgrade to pytest-django 3.9.0.

@blueyed
Copy link
Contributor

blueyed commented Apr 2, 2020

Duplicate of #6947.

@blueyed blueyed closed this as completed Apr 2, 2020
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

3 participants