Skip to content

Commit

Permalink
better configuration for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
loechel committed May 23, 2017
1 parent adfd30c commit d140667
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 7 deletions.
5 changes: 4 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ omit =
#src/RestrictedPython/tests/*.py

[report]
precision = 3
precision = 2

[html]
directory = reports/coverage
7 changes: 5 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ addopts =
testpaths =
tests
src/RestrictedPython/tests

norecursedirs = fixures

isort_ignore =
Expand All @@ -32,18 +33,20 @@ isort_ignore =
[isort]
force_alphabetical_sort = True
force_single_line = True
lines_after_imports = 2

line_length = 200
lines_after_imports = 2

skip =
bootstrap.py

not_skip =
__init__.py

[flake8]
exclude =
bootstrap.py,
src/RestrictedPython/tests,
src/RestrictedPython/SelectCompiler.py,

ignore =
N801,
Expand Down
29 changes: 25 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[tox]
envlist =
flake8,
coverage-clean,
py27,
py27-datetime,
Expand All @@ -12,19 +11,24 @@ envlist =
pypy,
docs,
isort,
flake8,
coverage-report,

skip_missing_interpreters = False

[testenv]
usedevelop = True
extras =
develop
test

commands =
pytest --cov=src --cov-report=xml --html=report-{envname}.html --self-contained-html {posargs}
pytest --cov=src --cov-report=xml --html=reports/pytest/report-{envname}.html --self-contained-html {posargs}
pytest --doctest-modules src/RestrictedPython/compile.py {posargs}

setenv =
COVERAGE_FILE=.coverage.{envname}

deps =
pytest
pytest-cov
Expand Down Expand Up @@ -63,6 +67,7 @@ basepython = python2.7
deps = coverage
setenv =
COVERAGE_FILE=.coverage

skip_install = true
commands =
coverage combine
Expand All @@ -84,8 +89,24 @@ commands =

[testenv:flake8]
basepython = python2.7
deps = flake8
commands = flake8 --doctests src tests setup.py
deps =
flake8
flake8-html
flake8-coding
flake8-debugger
flake8-deprecated
flake8-isort
flake8-pep3101
flake8-plone-hasattr
flake8-polyfill
flake8-print
flake8-quotes
flake8-string-format
flake8-todo

commands =
- flake8 --format=html --htmldir={toxinidir}/reports/flake8 --doctests src tests setup.py {posargs}
flake8 --doctests src tests setup.py {posargs}

[testenv:docs]
basepython = python2.7
Expand Down

0 comments on commit d140667

Please sign in to comment.