]> git.phdru.name Git - sqlconvert.git/blob - tox.ini
95fa7c7ad1e74feac66259eac41514d8b3c7ed48
[sqlconvert.git] / tox.ini
1 [tox]
2 minversion = 2.0
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     cmd
26     createdb
27     dropdb
28
29 [general]
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]
38 platform = linux|win32
39 commands = {[general]commands}
40
41 [testenv:py34]
42 platform = linux|win32
43 commands = {[general]commands}
44
45 [testenv:py35]
46 platform = linux|win32
47 commands = {[general]commands}
48
49 [testenv:py36]
50 platform = linux|win32
51 commands = {[general]commands}
52
53 [testenv:py37]
54 platform = linux|win32
55 commands = {[general]commands}
56
57 [testenv:py38]
58 platform = linux|win32
59 commands = {[general]commands}
60
61 [testenv:py39]
62 platform = linux|win32
63 commands = {[general]commands}
64
65 # PostgreSQL test environments
66 [postgresql]
67 commands =
68     {[testenv]commands}
69     -dropdb -U postgres -w test
70     createdb -U postgres -w test
71     {envpython} -m pytest --cov=sqlconvert -D postgres://postgres:@localhost/test
72     dropdb -U postgres -w test
73
74 [testenv:py27-postgres]
75 commands = {[postgresql]commands}
76
77 [testenv:py34-postgres]
78 commands = {[postgresql]commands}
79
80 [testenv:py35-postgres]
81 commands = {[postgresql]commands}
82
83 [testenv:py36-postgres]
84 commands = {[postgresql]commands}
85
86 [testenv:py37-postgres]
87 commands = {[postgresql]commands}
88
89 [testenv:py38-postgres]
90 commands = {[postgresql]commands}
91
92 [testenv:py39-postgres]
93 commands = {[postgresql]commands}
94
95 [postgres-w32]
96 platform = win32
97 commands =
98     {[testenv]commands}
99     -dropdb -U postgres -w test
100     createdb -U postgres -w test
101     pytest --cov=sqlconvert -D "postgres://postgres:Password12!@localhost/test"
102     dropdb -U postgres -w test
103
104 [testenv:py27-postgres-w32]
105 platform = win32
106 commands = {[postgres-w32]commands}
107
108 [testenv:py34-postgres-w32]
109 platform = win32
110 commands = {[postgres-w32]commands}
111
112 [testenv:py35-postgres-w32]
113 platform = win32
114 commands = {[postgres-w32]commands}
115
116 [testenv:py36-postgres-w32]
117 platform = win32
118 commands = {[postgres-w32]commands}
119
120 [testenv:py37-postgres-w32]
121 platform = win32
122 commands =
123     cmd /c "copy devscripts\\CI\\validators.py {envsitepackagesdir}\\formencode\\validators.py"
124     {[postgres-w32]commands}
125
126 [testenv:py38-postgres-w32]
127 platform = win32
128 commands =
129     {[postgres-w32]commands}
130
131 [testenv:py39-postgres-w32]
132 platform = win32
133 commands =
134     {[postgres-w32]commands}
135
136 # SQLite test environments
137 [sqlite]
138 commands =
139     {[testenv]commands}
140     -rm.py -f /tmp/test.sqdb
141     {envpython} -m pytest --cov=sqlconvert -D sqlite:///tmp/test.sqdb
142     rm.py -f /tmp/test.sqdb
143
144 [testenv:py27-sqlite]
145 commands = {[sqlite]commands}
146
147 [testenv:py34-sqlite]
148 commands = {[sqlite]commands}
149
150 [testenv:py35-sqlite]
151 commands = {[sqlite]commands}
152
153 [testenv:py36-sqlite]
154 commands = {[sqlite]commands}
155
156 [testenv:py37-sqlite]
157 commands = {[sqlite]commands}
158
159 [testenv:py38-sqlite]
160 commands = {[sqlite]commands}
161
162 [testenv:py39-sqlite]
163 commands = {[sqlite]commands}
164
165 [sqlite-w32]
166 platform = win32
167 commands =
168     {[testenv]commands}
169     -rm.py -f C:/projects/sqlconvert/test.sqdb
170     pytest --cov=sqlconvert -D sqlite:/C:/projects/sqlconvert/test.sqdb?debug=1
171     rm.py -f C:/projects/sqlconvert/test.sqdb
172
173 [testenv:py27-sqlite-w32]
174 platform = win32
175 commands = {[sqlite-w32]commands}
176
177 [testenv:py34-sqlite-w32]
178 platform = win32
179 commands = {[sqlite-w32]commands}
180
181 [testenv:py35-sqlite-w32]
182 platform = win32
183 commands = {[sqlite-w32]commands}
184
185 [testenv:py36-sqlite-w32]
186 platform = win32
187 commands = {[sqlite-w32]commands}
188
189 [testenv:py37-sqlite-w32]
190 platform = win32
191 commands =
192     cmd /c "copy devscripts\\CI\\validators.py {envsitepackagesdir}\\formencode\\validators.py"
193     {[sqlite-w32]commands}
194
195 [testenv:py38-sqlite-w32]
196 platform = win32
197 commands =
198     {[sqlite-w32]commands}
199
200 [testenv:py39-sqlite-w32]
201 platform = win32
202 commands =
203     {[sqlite-w32]commands}
204
205 # flake8
206 [testenv:py27-flake8]
207 platform = linux|win32
208 deps =
209     flake8
210 commands =
211     {[testenv]commands}
212     flake8
213
214 [testenv:py39-flake8]
215 platform = linux|win32
216 deps =
217     flake8
218 commands =
219     {[testenv]commands}
220     flake8