27๐
You should be able to match against the migrations directory to omit those files. Have you tried quoting the argument? Depending on your OS and shell, it may be expanding those asterisks prematurely. Try it like this:
--omit='*migrations*'
Alternately, you could put the switch into a .coveragerc file:
[run]
omit = *migrations*
๐คNed Batchelder
- [Django]-Cannot install psycopg2 Ubuntu
- [Django]-How do you log server errors on django sites
- [Django]-How to send html email with django with dynamic content in it?
2๐
Latest version of django-jenkins has new option COVERAGE_WITH_MIGRATIONS that would exclude migrations. Itโs not in PyPI yet so you need to install it with pip/easy_install specyfing url git url as source.
๐คDimmuR
- [Django]-How to apply multiple filters on a Django template variable?
- [Django]-H14 error in heroku โ "no web processes running"
- [Django]-How to disable Django's invalid HTTP_HOST error?
- [Django]-Can I make list_filter in django admin to only show referenced ForeignKeys?
- [Django]-Django template escaping
- [Django]-'EntryPoints' object has no attribute 'get' โ Digital ocean
0๐
This worked for me:
coverage run --source='.' --omit='*/migrations/*.py' manage.py test
- [Django]-How to get the currently logged in user's id in Django?
- [Django]-Setting Django up to use MySQL
- [Django]-Choose test database?
-3๐
try:
coverage run --source=. manage.py test app_name
this ignores third party code and fixes your % problem
๐คuser1422535
- [Django]-How to manage local vs production settings in Django?
- [Django]-Remove pk field from django serialized objects
- [Django]-Django โ Simple custom template tag example
Source:stackexchange.com