pytest-django tests are way slower than Django's own test runner
pytest-django 4.7, Django 4.2, Postgres 15. Running pytest takes three minutes for 300 tests; manage.py test takes 20 seconds. Same tests more or less. I assume it's database setup — is there a way to make pytest-django reuse the database instead of recreating and remigrating it on every run? Three minutes is starting to hurt the edit-test loop. Most of them are pure unit tests anyway, so paying database setup for each run feels especially dumb.
4 replies