forked from mfogel/django-timezone-field
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
67 lines (61 loc) · 1.96 KB
/
tox.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
[tox]
requires =
tox-docker
envlist =
coverage-clean,
py35-{django22}-{sqlite,postgres},
py36-{django22,django30,django31}-{sqlite,postgres},
py37-{django22,django30,django31}-{sqlite,postgres},
py38-{django22,django30,django31}-{sqlite,postgres},
py39-{django11,django22,django30,django31}-{sqlite,postgres},
coverage-report,
py39-flake8
[testenv]
commands = coverage run --include='*/timezone_field/*' {envbindir}/django-admin.py test tests
deps =
coverage
djangorestframework>=3.0.0
django11: django>=1.11.29,<2.0
django22: django>=2.2.17,<2.3
django30: django>=3.0.0,<3.1
django31: django>=3.1.0,<3.2
postgres: psycopg2-binary
setenv =
PYTHONPATH = {toxinidir}
DJANGO_SETTINGS_MODULE=tests.settings
sqlite: TEST_DB_ENGINE=sqlite
postgres: TEST_DB_ENGINE=postgres
[testenv:py{35,36,37,38,39}-{django11,django22,django30,django31}-postgres]
docker =
db
[testenv:py39-flake8]
commands = flake8
deps = flake8
[testenv:coverage-clean]
commands = coverage erase
[testenv:coverage-report]
commands =
coverage report
coverage html
[docker:db]
image = docker.io/bitnami/postgresql:13-debian-10
# Environment variables are passed to the container. They are only
# available to that container, and not to the testenv, other
# containers, or as replacements in other parts of tox.ini
environment =
POSTGRESQL_USERNAME=test_user
POSTGRESQL_PASSWORD=test_user
POSTGRESQL_DATABASE=timezone_field_tests
POSTGRES_INITDB_ARGS=--encoding=UTF-8
ports =
5599:5432/tcp
# The healthcheck ensures that tox-docker won't run tests until the
# container is up and the command finishes with exit code 0 (success)
healthcheck_cmd = PGPASSWORD=$POSTGRESQL_PASSWORD psql \
--user=$POSTGRESQL_USERNAME --dbname=$POSTGRESQL_DATABASE \
--host=127.0.0.1 --quiet --no-align --tuples-only \
-1 --command="SELECT 1"
healthcheck_timeout = 1
healthcheck_retries = 30
healthcheck_interval = 1
healthcheck_start_period = 1