]> 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}{,-sqlite},py{27,36,311}-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}]
22 commands =
23     {[testenv]commands}
24     {envpython} -m pytest
25     {envpython} {envbindir}/mysql2sql -P demo/demo.sql test.out
26     cmp.py -i tests/mysql2sql/test.out test.out
27     rm.py -f test.out
28
29 [testenv:py{27,34,35,36,37,38,39,310,311}-sqlite]
30 commands =
31     {[testenv]commands}
32     -rm.py -f /tmp/test.sqdb
33     {envpython} -m pytest -D sqlite:///tmp/test.sqdb
34     rm.py -f /tmp/test.sqdb
35
36 [testenv:py{27,34,35,36,37,38,39,310,311}-sqlite-w32]
37 platform = win32
38 commands =
39     {[testenv]commands}
40     -rm.py -f {env:TEMP}/test.sqdb
41     pytest -D sqlite:/{env:TEMP}/test.sqdb?debug=1
42     rm.py -f {env:TEMP}/test.sqdb
43
44 [testenv:py{27,34,35,36,37,38,39,310,311}-postgres{,-w32}]
45 commands =
46     {[testenv]commands}
47     -dropdb --username=runner test
48     createdb --username=runner test
49     {envpython} -m pytest -D postgres://runner:test@localhost/test
50     dropdb --username=runner test
51
52 # flake8
53 [testenv:py{27,34,35,36,37,38,39,310,311}-flake8]
54 deps =
55     flake8
56     pytest < 7.0
57 commands =
58     {[testenv]commands}
59     flake8