The expected behaviour of Django test is loading the models and serializers first, so the coverage should be 100% for them except there are some other implementations (e.g. To String definition, model methods, custom save/delete, validators, or path getter for file upload). So, I've tried three approaches to workaround django-nose
bug and achieving that:
- Use
coverage
on GitLab CI while maintaining thedjango_nose
settings, FAILED (both Windows and Linux). - Import
coverage
library viamanage.py
and dropping--with-coverage
setting fordjango_nose
, SUCCESS on Windows (coverage 90%, models/serializers no longer 0%), FAILED on Linux - DROPPING
django-nose
from requirements and use the standardunittest
library, withcoverage
import still inmanage.py
to maintain existing workflow. SUCCESS on both Windows and Linux (coverage 90%, models/serializers no longer 0%), but at the expense of losingstdout
grouping for each tests, making it harder to debug tests in general. This is the latest one I used right now.
Closes #198 (closed).