Skip to content

Commit

Permalink
Add tox configuration
Browse files Browse the repository at this point in the history
Allows to run tests with python versions 2.6, 2.7 and 3.5:

  tox -e py26
  tox -e py27
  tox -e py35

and run the pyflakes and pep8 tests:

  tox -e pep8
  tox -e pyflakes

For now this works separately from the makefile invoked tests, but
will eventually replace that.

Change-Id: I148d06f3a907dd92f903474ac3d9af0342f90d52
  • Loading branch information
dpursehouse committed Jun 7, 2016
1 parent 6863012 commit 4ff1c2e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
.pydevproject
.settings
.idea
.tox
.eggs
build/
dist/
docs/
Expand Down
25 changes: 25 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[tox]
minversion = 2.1.1
envlist = pep8, py35, py27, py26

[testenv]
setenv = VIRTUAL_ENV={envdir}
SUBUNIT_FORMATTER=tee testr_subunit_log
OS_STDOUT_NOCAPTURE=False
LANG=en_US.UTF-8
usedevelop = True
install_command = pip install {opts} {packages}
deps = -r{toxinidir}/test_requirements.txt
commands = python unittests.py

[testenv:pep8]
commands = flake8

[testenv:pyflakes]
deps = pyflakes
commands = pyflakes pygerrit2 unittests.py example.py setup.py

[flake8]
max-line-length = 80
show-source = True
exclude = .venv,.tox,dist,doc,build,*.egg,.test,pygerrit2env

0 comments on commit 4ff1c2e

Please sign in to comment.