Skip to content

Commit b03d165

Browse files
authored
Merge branch 'master' into bandit
2 parents 5ed9c49 + 58d07f9 commit b03d165

File tree

5 files changed

+31
-1
lines changed

5 files changed

+31
-1
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ matrix:
88
include:
99
- python: 3.8
1010
env: TOXENV=security
11+
- python: 3.8
12+
env: TOXENV=flake8
1113
- python: 2.7
1214
env: TOXENV=py27
1315
- python: pypy

conftest.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
def pytest_collection_modifyitems(session, config, items):
2+
# Avoid executing tests when executing `--flake8` flag (pytest-flake8)
3+
try:
4+
from pytest_flake8 import Flake8Item
5+
if config.getoption('--flake8'):
6+
items[:] = [item for item in items if isinstance(item, Flake8Item)]
7+
except ImportError:
8+
pass

docs/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
# Add any Sphinx extension module names here, as strings. They can be
4242
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
4343
extensions = [
44+
'notfound.extension',
4445
'sphinx.ext.autodoc',
4546
'sphinx.ext.intersphinx',
4647
'sphinx.ext.viewcode',

pytest.ini

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,12 @@
11
[pytest]
22
addopts = --doctest-modules --assert=plain --ignore=setup.py
3+
flake8-ignore =
4+
docs/conf.py E265 E402
5+
parsel/csstranslator.py E402 E501
6+
parsel/selector.py E126 E305 E501
7+
parsel/utils.py E226 E501
8+
parsel/xpathfuncs.py E501
9+
tests/test_selector.py E124 E127 E128 E231 E265 E303 E501 F811 W293
10+
tests/test_selector_csstranslator.py E501
11+
tests/test_utils.py E501
12+
tests/test_xpathfuncs.py E501

tox.ini

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,25 @@ deps =
88
commands = py.test --cov=parsel --cov-report= {posargs:parsel tests}
99

1010
[testenv:security]
11-
basepython = python3
11+
basepython = python3.8
1212
deps =
1313
bandit
1414
commands =
1515
bandit -r -c .bandit.yml {posargs:parsel}
1616

17+
[testenv:flake8]
18+
basepython = python3.8
19+
deps =
20+
{[testenv]deps}
21+
pytest-flake8
22+
commands =
23+
pytest --flake8
24+
1725
[docs]
1826
changedir = docs
1927
deps =
2028
sphinx
29+
sphinx-notfound-page
2130
sphinx_rtd_theme
2231

2332
[testenv:docs]

0 commit comments

Comments
 (0)