]> git.phdru.name Git - sqlconvert.git/blob - tox.ini
Build(GHActions): Use `checkout@v4` instead of outdated `v2`
[sqlconvert.git] / tox.ini
1 [tox]
2 minversion = 3.15
3 envlist = py27,py3{4,5,6,7,8,9,10,11,12}{,-m2s,-sqlite},py{27,36,312}-flake8
4
5 # Base test environment settings
6 [testenv]
7 commands =
8     {envpython} --version
9     {envpython} -c "import struct; print(struct.calcsize('P') * 8)"
10     {envpython} -m pytest --version
11 deps =
12     -rdevscripts/requirements/requirements_tests.txt
13     postgres: psycopg2-binary
14 passenv = PGPASSWORD
15 platform = linux|win32
16 # Don't fail or warn on uninstalled commands
17 whitelist_externals =
18     createdb
19     dropdb
20
21 [testenv:py{27,34,35,36,37,38,39,310,311,312}]
22 commands =
23     {[testenv]commands}
24     {envpython} -m pytest
25
26 [testenv:py{27,34}-m2s]
27 commands =
28     {[testenv]commands}
29     {envpython} {envbindir}/mysql2sql -P demo/demo.sql test.out
30     cmp.py -i tests/mysql2sql/test.out2 test.out
31     rm.py -f test.out
32
33 [testenv:py{35,36,37,38,39,310,311,312}-m2s]
34 commands =
35     {[testenv]commands}
36     {envpython} {envbindir}/mysql2sql -P demo/demo.sql test.out
37     cmp.py -i tests/mysql2sql/test.out3 test.out
38     rm.py -f test.out
39
40 [testenv:py{27,34,35,36,37,38,39,310,311,312}-sqlite]
41 commands =
42     {[testenv]commands}
43     -rm.py -f /tmp/test.sqdb
44     {envpython} -m pytest -D sqlite:///tmp/test.sqdb
45     rm.py -f /tmp/test.sqdb
46
47 [testenv:py{27,34,35,36,37,38,39,310,311,312}-sqlite-w32]
48 platform = win32
49 commands =
50     {[testenv]commands}
51     -rm.py -f {env:TEMP}/test.sqdb
52     pytest -D sqlite:/{env:TEMP}/test.sqdb?debug=1
53     rm.py -f {env:TEMP}/test.sqdb
54
55 [testenv:py{27,34,35,36,37,38,39,310,311,312}-postgres{,-w32}]
56 commands =
57     {[testenv]commands}
58     -dropdb --username=runner test
59     createdb --username=runner test
60     {envpython} -m pytest -D postgres://runner:test@localhost/test
61     dropdb --username=runner test
62
63 # flake8
64 [testenv:py{27,34,35,36,37,38,39,310,311,312}-flake8]
65 deps =
66     flake8
67     pytest < 7.0
68 commands =
69     {[testenv]commands}
70     flake8