]> git.phdru.name Git - sqlconvert.git/blob - tox.ini
Tests(tox): Fix copying `validators.py`
[sqlconvert.git] / tox.ini
1 [tox]
2 minversion = 2.0
3 envlist = py27,py3{4,5,6,7,8}{,-sqlite},py{27,38}-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 commands =
15     {envpython} --version
16     {envpython} -c "import struct; print(struct.calcsize('P') * 8)"
17 deps =
18     -rdevscripts/requirements/requirements_tests.txt
19     postgres: psycopg2-binary
20 passenv = PGPASSWORD
21 platform = linux
22 # Don't fail or warn on uninstalled commands
23 whitelist_externals =
24     cmd
25     createdb
26     dropdb
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 -f 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 [testenv:py37]
49 commands = {[general]commands}
50
51 [testenv:py38]
52 commands = {[general]commands}
53
54 # PostgreSQL test environments
55 [postgresql]
56 commands =
57     {[testenv]commands}
58     -dropdb -U postgres -w test
59     createdb -U postgres -w test
60     {envpython} -m pytest --cov=sqlconvert -D postgres://postgres:@localhost/test
61     dropdb -U postgres -w test
62
63 [testenv:py27-postgres]
64 commands = {[postgresql]commands}
65
66 [testenv:py34-postgres]
67 commands = {[postgresql]commands}
68
69 [testenv:py35-postgres]
70 commands = {[postgresql]commands}
71
72 [testenv:py36-postgres]
73 commands = {[postgresql]commands}
74
75 [testenv:py37-postgres]
76 commands = {[postgresql]commands}
77
78 [testenv:py38-postgres]
79 commands = {[postgresql]commands}
80
81 [postgres-w32]
82 platform = win32
83 commands =
84     {[testenv]commands}
85     -dropdb -U postgres -w test
86     createdb -U postgres -w test
87     pytest --cov=sqlconvert -D "postgres://postgres:Password12!@localhost/test"
88     dropdb -U postgres -w test
89
90 [testenv:py27-postgres-w32]
91 platform = win32
92 commands = {[postgres-w32]commands}
93
94 [testenv:py34-postgres-w32]
95 platform = win32
96 commands = {[postgres-w32]commands}
97
98 [testenv:py35-postgres-w32]
99 platform = win32
100 commands = {[postgres-w32]commands}
101
102 [testenv:py36-postgres-w32]
103 platform = win32
104 commands = {[postgres-w32]commands}
105
106 [testenv:py37-postgres-w32]
107 platform = win32
108 commands =
109     cmd /c "copy devscripts\\CI\\validators.py {envsitepackagesdir}\\formencode\\validators.py"
110     {[postgres-w32]commands}
111
112 [testenv:py38-postgres-w32]
113 platform = win32
114 commands =
115     {[postgres-w32]commands}
116
117 # SQLite test environments
118 [sqlite]
119 commands =
120     {[testenv]commands}
121     -rm.py -f /tmp/test.sqdb
122     {envpython} -m pytest --cov=sqlconvert -D sqlite:///tmp/test.sqdb
123     rm.py -f /tmp/test.sqdb
124
125 [testenv:py27-sqlite]
126 commands = {[sqlite]commands}
127
128 [testenv:py34-sqlite]
129 commands = {[sqlite]commands}
130
131 [testenv:py35-sqlite]
132 commands = {[sqlite]commands}
133
134 [testenv:py36-sqlite]
135 commands = {[sqlite]commands}
136
137 [testenv:py37-sqlite]
138 commands = {[sqlite]commands}
139
140 [testenv:py38-sqlite]
141 commands = {[sqlite]commands}
142
143 [sqlite-w32]
144 platform = win32
145 commands =
146     {[testenv]commands}
147     -rm.py -f C:/projects/sqlconvert/test.sqdb
148     pytest --cov=sqlconvert -D sqlite:/C:/projects/sqlconvert/test.sqdb?debug=1
149     rm.py -f C:/projects/sqlconvert/test.sqdb
150
151 [testenv:py27-sqlite-w32]
152 platform = win32
153 commands = {[sqlite-w32]commands}
154
155 [testenv:py34-sqlite-w32]
156 platform = win32
157 commands = {[sqlite-w32]commands}
158
159 [testenv:py35-sqlite-w32]
160 platform = win32
161 commands = {[sqlite-w32]commands}
162
163 [testenv:py36-sqlite-w32]
164 platform = win32
165 commands = {[sqlite-w32]commands}
166
167 [testenv:py37-sqlite-w32]
168 platform = win32
169 commands =
170     cmd /c "copy devscripts\\CI\\validators.py {envsitepackagesdir}\\formencode\\validators.py"
171     {[sqlite-w32]commands}
172
173 [testenv:py38-sqlite-w32]
174 platform = win32
175 commands =
176     {[sqlite-w32]commands}
177
178 # flake8
179 [testenv:py27-flake8]
180 deps =
181     flake8
182 commands =
183     {[testenv]commands}
184     flake8
185
186 [testenv:py38-flake8]
187 deps =
188     flake8
189 commands =
190     {[testenv]commands}
191     flake8