-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtox.ini
114 lines (91 loc) · 2.86 KB
/
tox.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# tox (https://tox.readthedocs.io/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.
[tox]
envlist = bash_only, py27, py35, pypy, pypy3
# prevent doing `setup.py develop`
# use `pip install -rrequirements.txt` instead (see further)
skipsdist = True
[testenv]
# https://github.com/tox-dev/tox/issues/601
whitelist_externals = /bin/true
list_dependencies_command = true
deps =
-rrequirements.txt
commands =
;{envpython} {toxinidir}/setup.py develop
{envpython} -m compileall -q pynogram tests
{envbindir}/flake8
# no need to run erase expicilty as `coverage run`
# without '-a' option truncate it anyway
;{envbindir}/coverage erase
{envbindir}/coverage run {envbindir}/pytest {posargs}
# use `xdg-open htmlcov/index.html` to view report
- {envbindir}/coverage html
{envbindir}/coverage report
passenv = TRAVIS TRAVIS_*
# run bash dependent style tests
[testenv:bash_only]
whitelist_externals =
/bin/true
/bin/bash
deps =
commands =
# update pre-push hook to run tox itself on pushing to origin
bash -c "d={toxinidir}/.git/hooks; f=$d/pre-push; if [ -d $d ] && [ ! -e $f ]; then echo -e \
'#!/bin/bash\nif [ $\{1\}x == originx ]; then tox; fi' > $f && chmod +x $f; fi"
# style fixer
bash -e {toxinidir}/.fix.sh --unicode
[testenv:lint]
deps =
-rrequirements.txt
pylint
commands =
{envbindir}/pylint {posargs:pynogram}
###################################################
# Here comes configuration sections for other tools
# like flake8 or coverage
[coverage:run]
branch = True
omit = .tox/*
setup.py
*/distutils/*.py
[coverage:report]
ignore_errors = True
skip_covered = True
fail_under = 95
exclude_lines =
# Don't complain if tests don't hit defensive assertion code:
raise NotImplementedError
raise AssertionError
# Have to re-enable the standard pragma
pragma: no cover
# Don't complain if tests run only on another Python version
sys.version_info <
sys.version_info >
# http://astrofrog.github.io/blog/2016/01/12/stop-writing-python-4-incompatible-code/
PY2
# Don't complain if pytest is skipped
pytest.mark.skip
[flake8]
max_line_length = 100
exclude =
.git
.tox
.eggs
build
# E402: module level import not at top of file
# E722: do not use bare except, specify exception instead
# more here https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes
# By default flake8 ignores some of the errors. Force to check all of them
ignore=W504
[pytest]
log_format = [%(asctime)s] %(levelname)-8s %(filename)s(%(threadName)s):%(lineno)d -> %(message)s
log_level = INFO
addopts =
--exitfirst
--verbose
# show extra summary on failed tests
-rf
--failed-first