Add tox.ini file

  • Factor out commands for most environments using {envname} substitution to build pytest commande.
  • Positional arguments are passed on to pytest (others may also be passed after a --).
  • Set PATH env variable for tests requiring PostgreSQL.
  • Also added a doc target to build the book.

Also update .hgignore exclude .tox directory (where virtualenvs will be created and cubicweb.egg-info created by sdist command).

Closes #5447161.

authorDenis Laxalde <denis.laxalde@logilab.fr>
changeset99bdd4bddd77
branchdefault
phasepublic
hiddenno
parent revision#84cb3299ec40 Add requirements.txt files in test directories
child revision#04637179562b [devtools] Serve web/data files using the DataController, #8879d0a95882 [serverctl] call server_{maintenance,shutdown} hooks around add-source, #f285db70f498 [test] use FakeFile instead of File in test_fulltextindex, #6b9ecf13a14a [test] use FakeFile instead of File in test_fulltextindex, #5302861d0ed7 [cwxml parser] refactor url handling code to use urlparse and urlencode (related to #5456849), #7bec01a59f92 [dataimport] dispatch and deprecate old code, #328689b3e3b9 [cwxml parser] refactor url handling code to use urlparse and urlencode (related to #5456849)
files modified by this revision
.hgignore
tox.ini
# HG changeset patch
# User Denis Laxalde <denis.laxalde@logilab.fr>
# Date 1435699065 -7200
# Tue Jun 30 23:17:45 2015 +0200
# Node ID 99bdd4bddd77aafa6dc9d0bee2604c20da92649e
# Parent 84cb3299ec4093b5f34fafd07f6921028cdb26d8
Add tox.ini file

* Factor out `commands` for most environments using {envname} substitution to
build pytest commande.
* Positional arguments are passed on to `pytest` (others may also be passed
after a `--`).
* Set PATH env variable for tests requiring PostgreSQL.
* Also added a `doc` target to build the book.

Also update .hgignore exclude .tox directory (where virtualenvs will be
created and cubicweb.egg-info created by sdist command).

Closes #5447161.

diff --git a/.hgignore b/.hgignore
@@ -1,8 +1,10 @@
1  \.svn
2  ^build$
3  ^dist$
4 +\.egg-info$
5 +^.tox$
6  \.pyc$
7  \.pyo$
8  \.bak$
9  \.old$
10  \~$
diff --git a/tox.ini b/tox.ini
@@ -0,0 +1,52 @@
11 +[tox]
12 +env = py27
13 +
14 +[testenv]
15 +sitepackages = True
16 +setenv =
17 +  PATH=/usr/lib/postgresql/9.4/bin:$PATH
18 +commands = pytest -t {envname}/test {posargs}
19 +
20 +[testenv:cubicweb]
21 +deps =
22 +  -r{toxinidir}/test/requirements.txt
23 +commands = pytest -t test {posargs}
24 +
25 +[testenv:dataimport]
26 +
27 +[testenv:devtools]
28 +deps =
29 +  -r{toxinidir}/devtools/test/requirements.txt
30 +
31 +[testenv:entities]
32 +deps =
33 +  -r{toxinidir}/entities/test/requirements.txt
34 +
35 +[testenv:etwist]
36 +deps =
37 +  -r{toxinidir}/etwist/test/requirements.txt
38 +
39 +[testenv:ext]
40 +deps =
41 +  -r{toxinidir}/ext/test/requirements.txt
42 +
43 +[testenv:hooks]
44 +
45 +[testenv:server]
46 +deps =
47 +  -r{toxinidir}/server/test/requirements.txt
48 +
49 +[testenv:sobjects]
50 +deps =
51 +  -r{toxinidir}/sobjects/test/requirements.txt
52 +
53 +[testenv:web]
54 +deps =
55 +  -r{toxinidir}/web/test/requirements.txt
56 +
57 +[testenv:wsgi]
58 +
59 +[testenv:doc]
60 +changedir = doc/book/en
61 +deps = sphinx
62 +commands = make html