]> git.phdru.name Git - sqlconvert.git/blob - tox.ini
Build: Require tox >= 2.0 (for passenv)
[sqlconvert.git] / tox.ini
1 [tox]
2 minversion = 2.0
3 envlist = {py27,py34,py35,py36},{py27,py34,py35,py36}-{postgres,postgres-w32,sqlite,sqlite-w32},{py27,py34}-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 commands =
13     {envpython} --version
14     {envpython} -c "import struct; print(struct.calcsize('P') * 8)"
15 deps =
16     -rdevscripts/requirements/requirements_tests.txt
17     postgres: psycopg2
18 passenv = PGPASSWORD
19 sitepackages = True
20 # Don't fail or warn on uninstalled commands
21 whitelist_externals =
22     createdb
23     dropdb
24     flake8
25     cmp.py
26     rm.py
27
28 [general]
29 commands =
30     {[testenv]commands}
31     {envpython} -m pytest --cov=sqlconvert
32     {envpython} {envbindir}/mysql2sql -P demo/demo.sql test.out
33     cmp.py -i tests/mysql2sql/test.out test.out
34     rm.py test.out
35
36 [testenv:py27]
37 commands = {[general]commands}
38
39 [testenv:py34]
40 commands = {[general]commands}
41
42 [testenv:py35]
43 commands = {[general]commands}
44
45 [testenv:py36]
46 commands = {[general]commands}
47
48 # PostgreSQL test environments
49 [postgresql]
50 commands =
51     {[testenv]commands}
52     -dropdb -U postgres -w test
53     createdb -U postgres -w test
54     {envpython} -m pytest --cov=sqlconvert -D postgres://postgres:@localhost/test
55     dropdb -U postgres -w test
56
57 [testenv:py27-postgres]
58 commands = {[postgresql]commands}
59
60 [testenv:py34-postgres]
61 commands = {[postgresql]commands}
62
63 [testenv:py35-postgres]
64 commands = {[postgresql]commands}
65
66 [testenv:py36-postgres]
67 commands = {[postgresql]commands}
68
69 [postgres-w32]
70 commands =
71     {[testenv]commands}
72     -dropdb -U postgres -w test
73     createdb -U postgres -w test
74     pytest --cov=sqlconvert -D "postgres://postgres:Password12!@localhost/test"
75     dropdb -U postgres -w test
76
77 [testenv:py27-postgres-w32]
78 commands = {[postgres-w32]commands}
79
80 [testenv:py34-postgres-w32]
81 commands = {[postgres-w32]commands}
82
83 [testenv:py35-postgres-w32]
84 commands = {[postgres-w32]commands}
85
86 [testenv:py36-postgres-w32]
87 commands = {[postgres-w32]commands}
88
89 # SQLite test environments
90 [sqlite]
91 commands =
92     {[testenv]commands}
93     -rm.py /tmp/test.sqdb
94     {envpython} -m pytest --cov=sqlconvert -D sqlite:///tmp/test.sqdb
95     rm.py /tmp/test.sqdb
96
97 [testenv:py27-sqlite]
98 commands = {[sqlite]commands}
99
100 [testenv:py34-sqlite]
101 commands = {[sqlite]commands}
102
103 [testenv:py35-sqlite]
104 commands = {[sqlite]commands}
105
106 [testenv:py36-sqlite]
107 commands = {[sqlite]commands}
108
109 [sqlite-w32]
110 commands =
111     {[testenv]commands}
112     -rm.py C:/projects/sqlconvert/test.sqdb
113     pytest --cov=sqlconvert -D sqlite:/C:/projects/sqlconvert/test.sqdb?debug=1
114     rm.py C:/projects/sqlconvert/test.sqdb
115
116 [testenv:py27-sqlite-w32]
117 commands = {[sqlite-w32]commands}
118
119 [testenv:py34-sqlite-w32]
120 commands = {[sqlite-w32]commands}
121
122 [testenv:py35-sqlite-w32]
123 commands = {[sqlite-w32]commands}
124
125 # flake8
126 [testenv:py27-flake8]
127 deps =
128     flake8
129 commands =
130     {[testenv]commands}
131     flake8
132
133 [testenv:py34-flake8]
134 deps =
135     flake8
136 commands =
137     {[testenv]commands}
138     flake8