5👍
✅
Assuming you’re using bash, you could use it to expand the parameters:
py.test --cov-report html --cov=app{1,2,3,4} */tests.py
You could also add those parameters to pytest.ini
so they’re passed automatically on each invocation.
3👍
@the-compiler ‘s answer did not work for me. If you want to test all apps, here is a way to do it:
pytest --cov-report html --cov=. */tests.py
source: https://medium.com/@harshvb7/using-pytest-to-write-tests-in-django-6783674c55b8
👤cgl
- [Django]-How to solve "No Python interpreter configured for the module"? in Android Studio?
- [Django]-DRF: Always apply default permission class
0👍
Before
After
Change this line in pytest.ini
python_files = tests.py test_*.py */tests_*.py
coverage run -m pytest
👤lava
- [Django]-How start server Django in the VM (Vagrant)
- [Django]-Missing mysql.sock; yielding OperationalError: (2002, "Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)")
- [Django]-Boto3 deprecation warning on import
- [Django]-What is the difference between SlugField() vs CharField() in Django models
- [Django]-How to set Celery with TTL so it purges old messages from a queue?
Source:stackexchange.com