[tox]
envlist = py27,pep8
minversion = 1.6
skipsdist = True

[testenv]
setenv = VIRTUAL_ENV={envdir}
passenv = TRACE_FAILONLY
usedevelop = True
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt,h=stable/newton} -U {opts} {packages}
deps = -egit+https://git.openstack.org/openstack/neutron@stable/newton#egg=neutron
       -egit+https://git.openstack.org/openstack/nova@stable/newton#egg=nova
       -r{toxinidir}/requirements.txt
       -r{toxinidir}/test-requirements.txt
whitelist_externals = sh
commands = python setup.py testr --slowest --testr-args='{posargs}'
# there is also secret magic in ostestr which lets you run in a fail only
# mode. To do this define the TRACE_FAILONLY environmental variable.

[testenv:scenario]
setenv = OS_TEST_PATH=./networking_vsphere/tests/scenario
passenv = {[testenv]passenv} TEMPEST_CONFIG_DIR
# If you are running the tests locally you should set the env variable
# TEMPEST_CONFIG_DIR=/opt/stack/networking-vsphere/networking_vsphere/tests/tempest/etc/

[testenv:pep8]
commands = flake8

[testenv:venv]
commands = {posargs}

[testenv:cover]
commands = python setup.py testr --coverage --testr-args='{posargs}'

[testenv:docs]
commands = python setup.py build_sphinx

[flake8]
# E123 closing bracket does not match indentation of opening bracket's line
# E125 continuation line does not distinguish itself from next logical line
# H803 skipped on purpose per list discussion.
# H904 Wrap long lines in parentheses instead of a backslash.
# N343 Production code must not import from neutron.tests.*
ignore = E123,E125,H803,H904,N343
show-source = true
builtins = _

exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,networking_vsphere/tests/tempest

[hacking]
import_exceptions = networking_vsphere._i18n
local-check-factory = neutron.hacking.checks.factory
