When developing in Django, we can use the following command (or its variations) to run tests on all the apps written by us: python manage.py test
.
This will make Django look for test
directories, as well as files with names along the lines of test_*
.
What I am wondering about is whether there is a way to include into the testing a package that was installed via pip install -e /path/to/package/here
.
I am trying to do this because I want to change some code in this package to make it compatible with a latter Django version. The package does have unit-tests in the test
directory. However, it seems that it needs a virtual environment with Django to run those tests. Upon creating one, it is discovered that one needs to set up a project with settings to get it to work.
Hence, my thought was: if we already have a project that is using this package, can we not run its tests from the project itself?
If there is a better way of doing it, I am happy to hear it.
Aucun commentaire:
Enregistrer un commentaire