tox.ini 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. [tox]
  2. envlist = py{27,34,35,36}-{cext,nocext}
  3. [testenv]
  4. # note that we have a .coveragerc file that points coverage specifically
  5. # at ./lib/sqlalchemy, and *not* at the build that tox might create under .tox.
  6. # See the notes below for setenv for more detail.
  7. # also using --cov-append so that we can aggregate multiple runs together.
  8. # Jenkins etc. need to call "coverage erase" externally.
  9. cov_args=--cov=sqlalchemy --cov-report term --cov-append --cov-report xml --exclude-tag memory-intensive --exclude-tag timing-intensive -k "not aaa_profiling"
  10. usedevelop=
  11. cov: True
  12. deps=pytest
  13. pytest-xdist
  14. mock
  15. # needed only for correct profiling results
  16. # due to speed improvements in psycopg2 as of 2.7
  17. postgresql: psycopg2>=2.7
  18. mysql: mysqlclient
  19. mysql: pymysql
  20. # waiting for https://github.com/oracle/python-cx_Oracle/issues/75
  21. oracle: cx_oracle>=6.0.2
  22. oracle5: cx_oracle==5.2.1
  23. mssql: pyodbc
  24. mssql: pymssql
  25. cov: pytest-cov
  26. whitelist_externals=sh
  27. # PYTHONPATH - erased so that we use the build that's present
  28. # in .tox as the SQLAlchemy library to be imported
  29. #
  30. # PYTHONUSERSITE - this *MUST* be set so that the ./lib/ import
  31. # set up explicitly in test/conftest.py is *disabled*, again so that
  32. # when SQLAlchemy is built into the .tox area, we use that and not the
  33. # local checkout, at least when usedevelop=False
  34. #
  35. # BASECOMMAND - using an env variable here so we can use it
  36. # as a substitution in a command (see https://bitbucket.org/hpk42/tox/issues/307/)
  37. #
  38. # only use --dropfirst option if we're *not* using -n;
  39. # if -n is used, we're working in brand new DBs anyway, dropfirst
  40. # will collide on CI environments
  41. setenv=
  42. PYTHONPATH=
  43. PYTHONNOUSERSITE=1
  44. BASECOMMAND=python -m pytest --log-info=sqlalchemy.testing
  45. WORKERS={env:TOX_WORKERS:-n4}
  46. oracle,oracle5: WORKERS={env:TOX_WORKERS:-n2}
  47. nocext: DISABLE_SQLALCHEMY_CEXT=1
  48. cov: COVERAGE={[testenv]cov_args}
  49. sqlite: SQLITE={env:TOX_SQLITE:--db sqlite}
  50. postgresql: POSTGRESQL={env:TOX_POSTGRESQL:--db postgresql}
  51. mysql: MYSQL={env:TOX_MYSQL:--db mysql --db pymysql}
  52. oracle,oracle5: ORACLE={env:TOX_ORACLE:--db oracle}
  53. mssql: MSSQL={env:TOX_MSSQL:--db mssql --db mssql_pymssql}
  54. oracle,oracle5,mssql: IDENTS=--write-idents db_idents.txt
  55. oracle,oracle5,mssql: NOMEMORY=--nomemory
  56. backendonly: BACKENDONLY=--backend-only
  57. # tox as of 2.0 blocks all environment variables from the
  58. # outside, unless they are here (or in TOX_TESTENV_PASSENV,
  59. # wildcards OK). Need at least these
  60. passenv=ORACLE_HOME NLS_LANG TOX_POSTGRESQL TOX_MYSQL TOX_ORACLE TOX_MSSQL TOX_SQLITE TOX_WORKERS
  61. # for nocext, we rm *.so in lib in case we are doing usedevelop=True
  62. commands=
  63. nocext: sh -c "rm -f lib/sqlalchemy/*.so"
  64. {env:BASECOMMAND} {env:WORKERS} {env:SQLITE:} {env:POSTGRESQL:} {env:MYSQL:} {env:ORACLE:} {env:MSSQL:} {env:BACKENDONLY:} {env:IDENTS:} {env:NOMEMORY:} {env:COVERAGE:} {posargs}
  65. oracle,oracle5,mssql: python reap_dbs.py db_idents.txt
  66. [testenv:pep8]
  67. deps=flake8
  68. commands = python -m flake8 {posargs}
  69. [flake8]
  70. show-source = True
  71. ignore = E711,E712,E721,N806,D
  72. exclude=.venv,.git,.tox,dist,doc,*egg,build