But django docs shows /manage.py test and unittest classes (django.test.TestCase).
What are the advantages of using TestCase and the default test runner? Is it just a style decision or there is something more?
Sorry if this is not the right place for asking these kind of questions! Or if someone already asked it.
Thanks.
Eduardo.
TestCase has many features that haven’t been replicated in pytest-django. For example:
setUpTestData
installed_apps
databases
The more advanced your tests get, the more likely you’ll find one of these useful.
On the other hand, pytest has some neat features in fixtures, but there’s a workaround to use them with unittest TestCases.
My preference is pytest, with TestCase classes for their features, but using the plain assert style rather than the self.assert* functions, since it’s less to remember.
My preference is TestCase (from standard Python) as this implies one less dependency in my projects. I never found a killer feature in pytest over TestCase until now.