Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
This PR makes it possible to run the full
tox
suite on a developer's local machine.Why
This is really useful for making sure that developing changes do not break tests when run against older versions of Django or Python. This is also a good sanity check before submitting PRs, since it is exactly the same suite of tests that will run via CI.
How
To facilitate running
tox
locally, the only needed change was to addPGUSER=postgres
to thesetenv
section of thetox.ini
. This was defaulting to the developer's username so the tests could not connect to the DB that was running (sincepostgres
is the usual default for DB user name).Along with this, a new script was added (
./postgres-docker
) that makes it easy for a developer to spin up a PostgreSQL instance with all the proper extensions installed in order to run the fullpostgis
test suite that some of thetox
environment targets use.Therefore, running
tox
locally can look something like this:Note: there already existed a
postgis-tests.sh
script which was refactored a bit to utilize the newpostgres-docker
script for the same purpose that it was handling itself before.