]> git.phdru.name Git - sqlconvert.git/blob - tox.ini
460460d07604aa9ada9706c009fd6773ccfbf53e
[sqlconvert.git] / tox.ini
1 [tox]
2 minversion = 3.15
3 envlist = py27,py3{4,5,6,7,8,9}{,-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 commands =
16     {envpython} --version
17     {envpython} -c "import struct; print(struct.calcsize('P') * 8)"
18 deps =
19     -rdevscripts/requirements/requirements_tests.txt
20     postgres: psycopg2-binary
21 passenv = PGPASSWORD
22 platform = linux
23 # Don't fail or warn on uninstalled commands
24 whitelist_externals =
25     createdb
26     dropdb
27
28 [testenv:{py27,py34,py35,py36,py37,py38,py39}]
29 platform = linux|win32
30 commands =
31     {[testenv]commands}
32     {envpython} -m pytest --cov=sqlconvert
33     {envpython} {envbindir}/mysql2sql -P demo/demo.sql test.out
34     cmp.py -i tests/mysql2sql/test.out test.out
35     rm.py -f test.out
36
37 [testenv:{py27,py34,py35,py36,py37,py38,py39}-sqlite]
38 commands =
39     {[testenv]commands}
40     -rm.py -f /tmp/test.sqdb
41     {envpython} -m pytest --cov=sqlconvert -D sqlite:///tmp/test.sqdb
42     rm.py -f /tmp/test.sqdb
43
44 [testenv:{py27,py34,py35,py36,py37,py38,py39}-sqlite-w32]
45 platform = win32
46 commands =
47     {[testenv]commands}
48     -rm.py -f C:/projects/sqlconvert/test.sqdb
49     pytest --cov=sqlconvert -D sqlite:/C:/projects/sqlconvert/test.sqdb?debug=1
50     rm.py -f C:/projects/sqlconvert/test.sqdb
51
52 [testenv:{py27,py34,py35,py36,py37,py38,py39}-postgres]
53 commands =
54     {[testenv]commands}
55     -dropdb -U postgres -w test
56     createdb -U postgres -w test
57     {envpython} -m pytest --cov=sqlconvert -D postgres://postgres:@localhost/test
58     dropdb -U postgres -w test
59
60 [testenv:{py27,py34,py35,py36,py37,py38,py39}-postgres-w32]
61 platform = win32
62 commands =
63     {[testenv]commands}
64     -dropdb -U postgres -w test
65     createdb -U postgres -w test
66     pytest --cov=sqlconvert -D "postgres://postgres:Password12!@localhost/test"
67     dropdb -U postgres -w test
68
69 # flake8
70 [testenv:{py27,py34,py35,py36,py37,py38,py39}-flake8]
71 platform = linux|win32
72 deps =
73     flake8
74 commands =
75     {[testenv]commands}
76     flake8