3 ms·
I've been pretty disappointed with PyCharm's support for Pytest in a Django project -- seems to be incapable of overriding the `manage.py` test runner consisten
by theptip 9y ago
I've been pretty disappointed with PyCharm's support for Pytest in a Django project -- seems to be incapable of overriding the `manage.py` test runner consistently.
pytest-django has some docs[1] for how to plug into `manage.py`, but they are broken as of Django 1.10.
Anyone else had this problem?
[1]: https://github.com/pytest-dev/pytest-django/blob/master/docs/faq.rst#how-can-i-use-managepy-test-with-pytest-django https://github.com/pytest-dev/pytest-django/blob/master/docs...
- gegenschall 9y agoIt is actually discouraged by pytest-django[0] to run it using Django's test command. Just run `pytest` itself. [0]: https://pytest-django.readthedocs.io/en/latest/#why-would-i-use-this-instead-of-django-s-manage-py-test-command https://pytest-django.readthedocs.io/en/latest/#why-would-i-...
- theptip 9y agoYeah, see part one of my comment -- I've found that PyCharm is pretty bad at selecting `pytest` as the test runner. It works for test functions, but not for files/directories. Perhaps I'm missing something obvious, but PyCharm just uses `./manage.py test` even when I've selected Py.test as the project test runner.