]> git.phdru.name Git - sqlconvert.git/blob - tox.ini
Tests(tox.ini): Set platform
[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 platform = linux
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 -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 # 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 platform = win32
71 commands =
72     {[testenv]commands}
73     -dropdb -U postgres -w test
74     createdb -U postgres -w test
75     pytest --cov=sqlconvert -D "postgres://postgres:Password12!@localhost/test"
76     dropdb -U postgres -w test
77
78 [testenv:py27-postgres-w32]
79 platform = win32
80 commands = {[postgres-w32]commands}
81
82 [testenv:py34-postgres-w32]
83 platform = win32
84 commands = {[postgres-w32]commands}
85
86 [testenv:py35-postgres-w32]
87 platform = win32
88 commands = {[postgres-w32]commands}
89
90 [testenv:py36-postgres-w32]
91 platform = win32
92 commands = {[postgres-w32]commands}
93
94 # SQLite test environments
95 [sqlite]
96 commands =
97     {[testenv]commands}
98     -rm.py -f /tmp/test.sqdb
99     {envpython} -m pytest --cov=sqlconvert -D sqlite:///tmp/test.sqdb
100     rm.py -f /tmp/test.sqdb
101
102 [testenv:py27-sqlite]
103 commands = {[sqlite]commands}
104
105 [testenv:py34-sqlite]
106 commands = {[sqlite]commands}
107
108 [testenv:py35-sqlite]
109 commands = {[sqlite]commands}
110
111 [testenv:py36-sqlite]
112 commands = {[sqlite]commands}
113
114 [sqlite-w32]
115 platform = win32
116 commands =
117     {[testenv]commands}
118     -rm.py -f C:/projects/sqlconvert/test.sqdb
119     pytest --cov=sqlconvert -D sqlite:/C:/projects/sqlconvert/test.sqdb?debug=1
120     rm.py -f C:/projects/sqlconvert/test.sqdb
121
122 [testenv:py27-sqlite-w32]
123 platform = win32
124 commands = {[sqlite-w32]commands}
125
126 [testenv:py34-sqlite-w32]
127 platform = win32
128 commands = {[sqlite-w32]commands}
129
130 [testenv:py35-sqlite-w32]
131 platform = win32
132 commands = {[sqlite-w32]commands}
133
134 # flake8
135 [testenv:py27-flake8]
136 deps =
137     flake8
138 commands =
139     {[testenv]commands}
140     flake8
141
142 [testenv:py34-flake8]
143 deps =
144     flake8
145 commands =
146     {[testenv]commands}
147     flake8