Merge pull request #4179 from Gallaecio/user-friendlier-tox

Make tox configuration more user friendly
This commit is contained in:
Mikhail Korobov 2019-12-18 18:35:19 +05:00 committed by GitHub
commit 053319334c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 51 deletions

View File

@ -12,10 +12,9 @@ matrix:
- env: TOXENV=flake8
python: 3.8
- env: TOXENV=pypy3
python: 3.5
- env: TOXENV=py35
python: 3.5
- env: TOXENV=py35-pinned
- env: TOXENV=pinned
python: 3.5
- env: TOXENV=py36
python: 3.6
@ -23,7 +22,7 @@ matrix:
python: 3.7
- env: TOXENV=py38
python: 3.8
- env: TOXENV=py38-extra-deps
- env: TOXENV=extra-deps
python: 3.8
- env: TOXENV=docs
python: 3.6

View File

@ -203,17 +203,9 @@ Tests are implemented using the :doc:`Twisted unit-testing framework
Running tests
-------------
Make sure you have a recent enough :doc:`tox <tox:index>` installation:
To run all tests::
``tox --version``
If your version is older than 1.7.0, please update it first:
``pip install -U tox``
To run all tests go to the root directory of Scrapy source code and run:
``tox``
tox
To run a specific test (say ``tests/test_loader.py``) use:

64
tox.ini
View File

@ -4,7 +4,8 @@
# and then run "tox" from this directory.
[tox]
envlist = py35
envlist = security,flake8,py3
minversion = 1.7.0
[testenv]
deps =
@ -22,11 +23,28 @@ passenv =
commands =
py.test --cov=scrapy --cov-report= {posargs:--durations=10 docs scrapy tests}
[testenv:py35]
basepython = python3.5
[testenv:security]
basepython = python3
deps =
bandit
commands =
bandit -r -c .bandit.yml {posargs:scrapy}
[testenv:py35-pinned]
basepython = python3.5
[testenv:flake8]
basepython = python3
deps =
{[testenv]deps}
pytest-flake8
commands =
py.test --flake8 {posargs:docs scrapy tests}
[testenv:pypy3]
basepython = pypy3
commands =
py.test {posargs:--durations=10 docs scrapy tests}
[testenv:pinned]
basepython = python3
deps =
-ctests/constraints.txt
cryptography==2.0
@ -47,34 +65,11 @@ deps =
botocore==1.3.23
Pillow==3.4.2
[testenv:py36]
basepython = python3.6
[testenv:py37]
basepython = python3.7
[testenv:py38]
basepython = python3.8
[testenv:pypy3]
basepython = pypy3
commands =
py.test {posargs:--durations=10 docs scrapy tests}
[testenv:security]
basepython = python3.8
deps =
bandit
commands =
bandit -r -c .bandit.yml {posargs:scrapy}
[testenv:flake8]
basepython = python3.8
[testenv:extra-deps]
deps =
{[testenv]deps}
pytest-flake8
commands =
py.test --flake8 {posargs:docs scrapy tests}
reppy
robotexclusionrulesparser
[docs]
changedir = docs
@ -98,10 +93,3 @@ changedir = {[docs]changedir}
deps = {[docs]deps}
commands =
sphinx-build -W -b linkcheck . {envtmpdir}/linkcheck
[testenv:py38-extra-deps]
basepython = python3.8
deps =
{[testenv]deps}
reppy
robotexclusionrulesparser