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