pytest-dev / pytest-django

A Django plugin for pytest.
https://pytest-django.readthedocs.io/
Other
1.33k stars 341 forks source link

4.5.1: reset_sequences=True fails on MariaDB/MySQL #978

Closed joaquimds closed 2 years ago

joaquimds commented 2 years ago

Firstly, thanks for maintaining such a powerful and useful testing library for Django.

On to the bug:

Example:

@pytest.mark.django_db(reset_sequences=True)
def test_reset_sequences():
    assert True

Output:

ERROR my_test.py::test_reset_sequences - AssertionError: reset_sequences cannot be used on TestCase instances
bluetech commented 2 years ago

It's missing transaction=True. Needs a better error message.

Did it work on pytest-django 4.4.0? If yes, then I'll make it work again.

joaquimds commented 2 years ago

Thanks for the fast response! Yes it works on 4.5.0