File tree Expand file tree Collapse file tree 4 files changed +33
-0
lines changed Expand file tree Collapse file tree 4 files changed +33
-0
lines changed Original file line number Diff line number Diff line change 44 include :
55 - python : 3.8
66 env : TOXENV=security
7+ - python : 3.8
8+ env : TOXENV=flake8
79 - python : 2.7
810 env : TOXENV=py27
911 - python : pypy
Original file line number Diff line number Diff line change 11collect_ignore = ["setup.py" ]
2+
3+
4+ def pytest_collection_modifyitems (session , config , items ):
5+ # Avoid executing tests when executing `--flake8` flag (pytest-flake8)
6+ try :
7+ from pytest_flake8 import Flake8Item
8+ if config .getoption ('--flake8' ):
9+ items [:] = [item for item in items if isinstance (item , Flake8Item )]
10+ except ImportError :
11+ pass
Original file line number Diff line number Diff line change 11[pytest]
22doctest_optionflags = ALLOW_UNICODE ALLOW_BYTES
3+ flake8-ignore =
4+ docs/conf.py E121 E122 E265 E401 E501
5+ tests/test_encoding.py E128 E221 E241 E302 E401 E501 E731
6+ tests/test_form.py E265 E501
7+ tests/test_html.py E123 E128 E241 E303 E501 E502
8+ tests/test_http.py E128 E261 E302 W291
9+ tests/test_url.py E126 E127 E128 E226 E261 E303 E501 W293 W391
10+ w3lib/encoding.py E126 E128 E302 E305 E401 E501
11+ w3lib/form.py E402 E501 E721
12+ w3lib/html.py E128 E302 E501 E502 W504
13+ w3lib/http.py E501
14+ w3lib/url.py E128 E261 E302 E305 E501 F841 W291 W293 W504
15+ w3lib/util.py E302
Original file line number Diff line number Diff line change @@ -22,6 +22,14 @@ deps =
2222commands =
2323 bandit -r -c .bandit.yml {posargs:w3lib}
2424
25+ [testenv:flake8]
26+ basepython = python3
27+ deps =
28+ {[testenv]deps}
29+ pytest-flake8
30+ commands =
31+ pytest --flake8
32+
2533[docs]
2634changedir = docs
2735deps = -rdocs/requirements.txt
You can’t perform that action at this time.
0 commit comments