mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-11-04 06:15:28 +08:00
Lint the integration tests with Python 3
The integration tests under 'tests/integration' are Python 3 only. Flake8 will fail on Python 3 syntax when running under Python 2, but for now we wouldn't like to change this, in order to keep Python 2 compatibility of the code base. To work around the above, set up a separate tox environment to lint the integration tests, and exclude linting the integration tests when the rest of the code is checked. Signed-off-by: Hunor Csomortáni <csomh@redhat.com>
This commit is contained in:
@@ -22,4 +22,4 @@ sed -i \
|
||||
|
||||
# Since tox seems to ignore `usedevelop` when we have `sitepackages` on, we have to run it manually
|
||||
python3 setup.py develop --no-deps
|
||||
/usr/bin/tox -e flake8,py3 "$@"
|
||||
/usr/bin/tox -e flake8,py3,intflake "$@"
|
||||
|
||||
20
tox.ini
20
tox.ini
@@ -4,17 +4,12 @@
|
||||
# and then run "tox" from this directory.
|
||||
|
||||
[tox]
|
||||
envlist = flake8, py27, py3
|
||||
envlist = flake8, intflake, py27, py3
|
||||
|
||||
[flake8]
|
||||
ignore = E731,W503
|
||||
max-line-length = 100
|
||||
exclude =
|
||||
./.tox
|
||||
./.git
|
||||
./module_build_service/migrations
|
||||
./build
|
||||
./.env
|
||||
exclude = .tox,.git,module_build_service/migrations,build,.env
|
||||
|
||||
[testenv]
|
||||
usedevelop = true
|
||||
@@ -49,7 +44,16 @@ commands =
|
||||
basepython = python2
|
||||
skip_install = true
|
||||
deps = flake8
|
||||
commands = flake8
|
||||
# doing this until --extend-exclude support becomes available
|
||||
# https://flake8.readthedocs.io/en/latest/user/options.html#cmdoption-flake8-extend-exclude
|
||||
commands = flake8 --exclude={[flake8]exclude},tests/integration
|
||||
|
||||
[testenv:intflake]
|
||||
basepython = python3
|
||||
skip_install = true
|
||||
sitepackages = false
|
||||
deps = flake8
|
||||
commands = flake8 tests/integration
|
||||
|
||||
[testenv:bandit]
|
||||
basepython = python2
|
||||
|
||||
Reference in New Issue
Block a user