您可以首先确保没有覆盖 django_db_setup 在你的 conftest.py https://pytest-django.readthedocs.io/en/latest/database.html#django-db-setup
django_db_setup
conftest.py
在我的例子中,我通过从 -n auto (在我的服务器上使用12) -n 6 ,但我看到您已经用4个CPU运行了。也许可以把它减少到 -n 2 测试。
-n auto
-n 6
-n 2