]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- add tox.ini from 1.1
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 9 Feb 2016 15:56:47 +0000 (10:56 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 9 Feb 2016 15:56:47 +0000 (10:56 -0500)
tox_1_1.ini [new file with mode: 0644]

diff --git a/tox_1_1.ini b/tox_1_1.ini
new file mode 100644 (file)
index 0000000..7d5826a
--- /dev/null
@@ -0,0 +1,76 @@
+
+[tox]
+envlist = py{26,27,34,35}-{cext,nocext}
+
+[testenv]
+# note that we have a .coveragerc file that points coverage specifically
+# at ./lib/sqlalchemy, and *not* at the build that tox might create under .tox.
+# See the notes below for setenv for more detail.
+# also using --cov-append so that we can aggregate multiple runs together.
+# Jenkins etc. need to call "coverage erase" externally.
+cov_args=--cov=sqlalchemy --cov-report term --cov-append --cov-report xml --exclude-tag memory-intensive --exclude-tag timing-intensive -k "not aaa_profiling"
+
+usedevelop=
+     cov: True
+
+deps=pytest
+     pytest-xdist
+     mock
+     postgresql: psycopg2
+     mysql: mysqlclient
+     mysql: pymysql
+     oracle: cx_oracle
+     mssql: pyodbc
+     mssql: pymssql
+     cov: pytest-cov
+
+whitelist_externals=sh
+
+# PYTHONPATH - erased so that we use the build that's present
+# in .tox as the SQLAlchemy library to be imported
+#
+# PYTHONUSERSITE - this *MUST* be set so that the ./lib/ import
+# set up explicitly in test/conftest.py is *disabled*, again so that
+# when SQLAlchemy is built into the .tox area, we use that and not the
+# local checkout, at least when usedevelop=False
+#
+# BASECOMMAND - using an env variable here so we can use it
+# as a substitution in a command (see https://bitbucket.org/hpk42/tox/issues/307/)
+#
+setenv=
+    PYTHONPATH=
+    PYTHONNOUSERSITE=1
+    BASECOMMAND=python -m pytest --dropfirst
+
+    WORKERS=-n4
+    oracle: WORKERS=-n2
+    nocext: DISABLE_SQLALCHEMY_CEXT=1
+    cov: COVERAGE={[testenv]cov_args}
+    sqlite: SQLITE=--db sqlite
+    postgresql: POSTGRESQL=--db postgresql
+    mysql: MYSQL=--db mysql --db pymysql
+    oracle: ORACLE=--db oracle --low-connections
+    mssql: MSSQL=--db pyodbc --db pymssql
+    backendonly: BACKENDONLY=--backend-only
+
+# tox as of 2.0 blocks all environment variables from the
+# outside, unless they are here (or in TOX_TESTENV_PASSENV,
+# wildcards OK).  Need at least these
+passenv=ORACLE_HOME NLS_LANG
+
+# for nocext, we rm *.so in lib in case we are doing usedevelop=True
+commands=
+  {nocext}: sh -c "rm -f lib/sqlalchemy/*.so"
+  {env:BASECOMMAND} {env:WORKERS} {env:SQLITE:} {env:POSTGRESQL:} {env:MYSQL:} {env:ORACLE:} {env:MSSQL:} {env:BACKENDONLY:} {env:COVERAGE:} {posargs}
+  {oracle}: python reap_oracle_dbs.py
+
+
+[testenv:pep8]
+deps=flake8
+commands = python -m flake8 {posargs}
+
+[flake8]
+show-source = True
+ignore = E711,E712,E721,N806,D
+exclude=.venv,.git,.tox,dist,doc,*egg,build
+