Testing¶
For a fast test run using the available python, use pytest:
$ pytest tests
The test suite uses the following environment variables to connect to the database:
POSTGRES_DB
(defaultpgcopy_test
)POSTGRES_HOST
(default5432
)POSTGRES_PORT
POSTGRES_USER
POSTGRES_PASSWORD
For more thorough testing, tox with tox-docker will run tests on python versions 3.8 – 3.12 and postgresql versions 12 – 16:
$ tox
Additionally, the test suite can be run with no local requirements other than the ubiquitous docker:
$ docker-compose up pgcopy
Note
Tests for extension types will be skipped if the required db extension is not available.