]> git.phdru.name Git - sqlconvert.git/blob - tox.ini
Tests: Update tox.ini
[sqlconvert.git] / tox.ini
1 [tox]
2 minversion = 2.0
3 envlist = py{27,34,35,36}{,-sqlite},py{27,34}-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
25 [general]
26 commands =
27     {[testenv]commands}
28     {envpython} -m pytest --cov=sqlconvert
29     {envpython} {envbindir}/mysql2sql -P demo/demo.sql test.out
30     cmp.py -i tests/mysql2sql/test.out test.out
31     rm.py -f test.out
32
33 [testenv:py27]
34 commands = {[general]commands}
35
36 [testenv:py34]
37 commands = {[general]commands}
38
39 [testenv:py35]
40 commands = {[general]commands}
41
42 [testenv:py36]
43 commands = {[general]commands}
44
45 # PostgreSQL test environments
46 [postgresql]
47 commands =
48     {[testenv]commands}
49     -dropdb -U postgres -w test
50     createdb -U postgres -w test
51     {envpython} -m pytest --cov=sqlconvert -D postgres://postgres:@localhost/test
52     dropdb -U postgres -w test
53
54 [testenv:py27-postgres]
55 commands = {[postgresql]commands}
56
57 [testenv:py34-postgres]
58 commands = {[postgresql]commands}
59
60 [testenv:py35-postgres]
61 commands = {[postgresql]commands}
62
63 [testenv:py36-postgres]
64 commands = {[postgresql]commands}
65
66 [postgres-w32]
67 platform = win32
68 commands =
69     {[testenv]commands}
70     -dropdb -U postgres -w test
71     createdb -U postgres -w test
72     pytest --cov=sqlconvert -D "postgres://postgres:Password12!@localhost/test"
73     dropdb -U postgres -w test
74
75 [testenv:py27-postgres-w32]
76 platform = win32
77 commands = {[postgres-w32]commands}
78
79 [testenv:py34-postgres-w32]
80 platform = win32
81 commands = {[postgres-w32]commands}
82
83 [testenv:py35-postgres-w32]
84 platform = win32
85 commands = {[postgres-w32]commands}
86
87 [testenv:py36-postgres-w32]
88 platform = win32
89 commands = {[postgres-w32]commands}
90
91 # SQLite test environments
92 [sqlite]
93 commands =
94     {[testenv]commands}
95     -rm.py -f /tmp/test.sqdb
96     {envpython} -m pytest --cov=sqlconvert -D sqlite:///tmp/test.sqdb
97     rm.py -f /tmp/test.sqdb
98
99 [testenv:py27-sqlite]
100 commands = {[sqlite]commands}
101
102 [testenv:py34-sqlite]
103 commands = {[sqlite]commands}
104
105 [testenv:py35-sqlite]
106 commands = {[sqlite]commands}
107
108 [testenv:py36-sqlite]
109 commands = {[sqlite]commands}
110
111 [sqlite-w32]
112 platform = win32
113 commands =
114     {[testenv]commands}
115     -rm.py -f C:/projects/sqlconvert/test.sqdb
116     pytest --cov=sqlconvert -D sqlite:/C:/projects/sqlconvert/test.sqdb?debug=1
117     rm.py -f C:/projects/sqlconvert/test.sqdb
118
119 [testenv:py27-sqlite-w32]
120 platform = win32
121 commands = {[sqlite-w32]commands}
122
123 [testenv:py34-sqlite-w32]
124 platform = win32
125 commands = {[sqlite-w32]commands}
126
127 [testenv:py35-sqlite-w32]
128 platform = win32
129 commands = {[sqlite-w32]commands}
130
131 [testenv:py36-sqlite-w32]
132 platform = win32
133 commands = {[sqlite-w32]commands}
134
135 # flake8
136 [testenv:py27-flake8]
137 deps =
138     flake8
139 commands =
140     {[testenv]commands}
141     flake8
142
143 [testenv:py34-flake8]
144 deps =
145     flake8
146 commands =
147     {[testenv]commands}
148     flake8