labcodes/django-react-boilerplate

Add tox as test runner

Opened this issue · 1 comments

Tox is useful when it is necessary to test against various versions of the Python interpreter and libraries, etc and have an isolated test environment.
It is also good for not being locked to a specific CI system, only simple install tox and run tox

https://tox.readthedocs.io/en/latest/

A complex tox configuration sample:
https://github.com/lumocodes/django-versatileimagefield/blob/django3.2_tox_github_actions/tox.ini
https://github.com/lumocodes/django-celery-beat/blob/master/tox.ini

If the tests need external applications to run, there is the tox-docker plugin that is capable of running docker containers and stopping them during the testing process. In other words: it is an easy way to have postgresql running
A sample usage of tox-docker
https://github.com/lumocodes/django-timezone-field/blob/master/tox.ini#L46-L67

For a more generic case/project, I really like the idea, but, for our development/deployment cases, I don't think need to be worried with different python versions.
Since this boilerplate is mostly for our use, I even think that tox could be one more barrier to get people started.

(Oh, and we don't have any tests :B)